Vauxoo / addons-vauxoo

All our modules related to developments that solves generic issues on Odoo, or that solve internal problems on Odoo Core, if something is here, maybe it is solving an issue in your company, try it and report what you see.
http://www.vauxoo.com
193 stars 288 forks source link

[REF] product_extended_segmentation: When using the wizard to change … #1307

Closed keylor2906 closed 5 years ago

keylor2906 commented 5 years ago

…cost, change all segmented costs of product and its components

keylor2906 commented 5 years ago

@josemoralesp this PR is for recursivelly set the new costs for a product and all it's components using the wizard, also this fix the case that using the wizard was only setting the total cost and not all segments. The creation of the wizard during the calculation of segmented cost was split on a separate method because it will be inherited by lodi, because they will use a different account instead of the one that is already set, that is the one that odoo use by default.

josemoralesp commented 5 years ago

Hello @keylor2906

When we talked about this in the morning I was thinking about something like this:

This here.

 <xpath expr="//button[@name='compute_price']" position="attributes">
       <attribute name="context">{'from_wizard': False}</attribute>
</xpath>   

Then here

 prod_costs_dict = self._calc_price_seg(child_bom_id, self.env.context.get('from_wizard', True))

Then you should return sgmnt_dict here, with the key price.

What do you think?

What did you see that I couldn't see?

Best Regards.