Rifakat (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.1-opw-579859-rha into 
lp:openobject-addons/6.1.

Requested reviews:
  Naresh(OpenERP) (nch-openerp)
Related bugs:
  Bug #1058390 in OpenERP Addons: "Wrong base amount of taxes in OpenERP 6.1"
  https://bugs.launchpad.net/openobject-addons/+bug/1058390

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-579859-rha/+merge/127725

Hello,

Corrected Base amount calculation for invoice, Base amount is not
identical to the untaxed amount. (lp:1058390)

Problem is in tax base amount calculation, it first rounds the unit price
and then multiplies with the qty. That should be done all together.

Its a backport of Trunk,
Revision 7646, Revision ID: [email protected]
(Courtesy to Alexis de Lattre)

Thanks for reviewing this fix,
Rifakat Haradwala
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-579859-rha/+merge/127725
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.1-opw-579859-rha.
=== modified file 'account/account_invoice.py'
--- account/account_invoice.py	2012-08-20 15:52:57 +0000
+++ account/account_invoice.py	2012-10-03 11:37:31 +0000
@@ -1586,14 +1586,13 @@
 
         for line in inv.invoice_line:
             for tax in tax_obj.compute_all(cr, uid, line.invoice_line_tax_id, (line.price_unit* (1-(line.discount or 0.0)/100.0)), line.quantity, inv.address_invoice_id.id, line.product_id, inv.partner_id)['taxes']:
-                tax['price_unit'] = cur_obj.round(cr, uid, cur, tax['price_unit'])
                 val={}
                 val['invoice_id'] = inv.id
                 val['name'] = tax['name']
                 val['amount'] = tax['amount']
                 val['manual'] = False
                 val['sequence'] = tax['sequence']
-                val['base'] = tax['price_unit'] * line['quantity']
+                val['base'] = cur_obj.round(cr, uid, cur, tax['price_unit'] * line['quantity'])
 
                 if inv.type in ('out_invoice','in_invoice'):
                     val['base_code_id'] = tax['base_code_id']

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to