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/ (+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:

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.


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
1=== modified file 'account/'
2--- account/ 2012-10-05 12:58:20 +0000
3+++ account/ 2012-12-11 16:55:27 +0000
4@@ -1589,7 +1589,6 @@
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-( or 0.0)/100.0)), line.quantity,, 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'] =
11 val['name'] = tax['name']