Hi Ravish, thanks for your answer. The issue only affects to the on_change method.
First time you add one invoice line, you can't verify the bug: in that case, all works fine. The problem comes, by example, when you add one line and, later, you re- link a product. Also the chosen product must be in different units than base ones (hours, by example). I have loaded a clean database with demo data and I have made a video to describe it. Patch explanation: * When you convert from one unit to another from the same category first you need to convert to base unit (multiplying by origin unit 'factor') and then to destination unit (multiplying by dest unit 'factor_inv'): In original code only first multiplication is done. I only have put factor_inv in the equation. * I also have added one condition (to the if) to avoid conversion when product unit is the same than line unit. The code will work without this but I think is more elegant this way. -- You received this bug notification because you are a member of OpenERP Indian Team, which is subscribed to OpenERP Addons. https://bugs.launchpad.net/bugs/1035394 Title: Bad price calculation (unit conversion) when product changes in invoice line Status in OpenERP Addons (modules): Incomplete Bug description: Version: openobject-addons 6.1 Revision: 6940 (and earlier) Module: account When you are using different units than base ones, a bad price calculation is done when you change product in an invoice line. Patch is attached. To manage notifications about this bug go to: https://bugs.launchpad.net/openobject-addons/+bug/1035394/+subscriptions _______________________________________________ Mailing list: https://launchpad.net/~openerp-india Post to : [email protected] Unsubscribe : https://launchpad.net/~openerp-india More help : https://help.launchpad.net/ListHelp

