Merge lp:~openerp-dev/openobject-addons/6.1-opw-579859-rha into lp:openobject-addons/6.1

Proposed by Rifakat Husen (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-579859-rha
Merge into: lp:openobject-addons/6.1
Diff against target: 19 lines (+1/-2)
1 file modified
account/account_invoice.py (+1/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-579859-rha
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+127725@code.launchpad.net

Description of the change

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 address hidden>
(Courtesy to Alexis de Lattre)

Thanks for reviewing this fix,
Rifakat Haradwala

To post a comment you must log in.
Revision history for this message
Alexis de Lattre (alexis-via) wrote :

WARNING : this fix is NOT merged in addons/6.1 ! Commit 7041 in addons/6.1 is for another bug, not for bug 1058390 !!!
Rifakat, could you please change the Status to "Needs review" ?

Alexis de Lattre

Revision history for this message
Rifakat Husen (OpenERP) (rha-openerp) wrote :

Just corrected the status,
Thanks for the notification Alexis.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/account_invoice.py'
2--- account/account_invoice.py 2012-08-20 15:52:57 +0000
3+++ account/account_invoice.py 2012-10-03 11:37:31 +0000
4@@ -1586,14 +1586,13 @@
5
6 for line in inv.invoice_line:
7 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']:
8- tax['price_unit'] = cur_obj.round(cr, uid, cur, tax['price_unit'])
9 val={}
10 val['invoice_id'] = inv.id
11 val['name'] = tax['name']
12 val['amount'] = tax['amount']
13 val['manual'] = False
14 val['sequence'] = tax['sequence']
15- val['base'] = tax['price_unit'] * line['quantity']
16+ val['base'] = cur_obj.round(cr, uid, cur, tax['price_unit'] * line['quantity'])
17
18 if inv.type in ('out_invoice','in_invoice'):
19 val['base_code_id'] = tax['base_code_id']