Merge lp:~synerpgy/openobject-addons/addons_61_fix into lp:openobject-addons/6.1

Proposed by YannickB (YOLO consulting)
Status: Needs review
Proposed branch: lp:~synerpgy/openobject-addons/addons_61_fix
Merge into: lp:openobject-addons/6.1
Diff against target: 11 lines (+0/-1)
1 file modified
account/account_invoice.py (+0/-1)
To merge this branch: bzr merge lp:~synerpgy/openobject-addons/addons_61_fix
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+139263@code.launchpad.net

Description of the change

Hi guys,

I want to point out a rounding issue I think I have found in tax line computation. As you can see, my patch is very simple.

Here is my real case :

price unit : 102.50, quantity 2, tax 7% included

In account.invoice.line subtotal field, I find the correct value 191.59, obtains by :
round(102.50 * 2 / 1.07)

But in tax line, base field, I have the value 191.58. After some research I found the computation made :
round(round(102.50 / 1.07) * 2)
which is wrong for me.

My MP remove this useless round. Why did you made it? It's clearly a voluntary act.

I may be wrong in my computation and round(round(102.50 / 1.07) * 2) would be the correct one.
But in this case : the subtotal account.invoice.line and the base field from tax.line currently differs by their computation, we have to correct either one or the other because currently it give us different amount in the very same document.

Regards,
Yannick.

To post a comment you must log in.

Unmerged revisions

7100. By yannick <yannick@serveur-perso>

Correct tax rounding issue

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'account/account_invoice.py'
--- account/account_invoice.py 2012-10-05 12:58:20 +0000
+++ account/account_invoice.py 2012-12-11 16:55:27 +0000
@@ -1589,7 +1589,6 @@
15891589
1590 for line in inv.invoice_line:1590 for line in inv.invoice_line:
1591 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']:1591 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']:
1592 tax['price_unit'] = cur_obj.round(cr, uid, cur, tax['price_unit'])
1593 val={}1592 val={}
1594 val['invoice_id'] = inv.id1593 val['invoice_id'] = inv.id
1595 val['name'] = tax['name']1594 val['name'] = tax['name']