Merge lp:~pedro.baeza/ocb-addons/7.0-bug-1173102 into lp:ocb-addons

Proposed by Pedro Manuel Baeza
Status: Rejected
Rejected by: Pedro Manuel Baeza
Proposed branch: lp:~pedro.baeza/ocb-addons/7.0-bug-1173102
Merge into: lp:ocb-addons
Diff against target: 13 lines (+1/-2)
1 file modified
account/account.py (+1/-2)
To merge this branch: bzr merge lp:~pedro.baeza/ocb-addons/7.0-bug-1173102
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) code review Needs Information
Review via email: mp+205911@code.launchpad.net

Description of the change

[FIX] account: Problem rounding taxes when taxes are included in price.

See lp:1173102 for more details.

To post a comment you must log in.
Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

This looks to me like someone calls _compute with the wrong precision. I think http://bazaar.launchpad.net/~ocb/ocb-addons/7.0/view/head:/account/account.py#L2189 is the culprit. Shouldn't we rather fix it there instead of ignoring the precision we get passed in _compute?

review: Needs Information (code review)
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

I have only copied the solution provided by OpenERP S. A. on trunk, testing that it's working on v7, but without checking the source of the problem. Do you think it can be more generic patching what you say?

Regards.

Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

I do think changing it where I wrote is the better fix, as it seems quite arbitrary to me to increase rounding precision there

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

It's solved on upstream.

Unmerged revisions

9920. By Pedro Manuel Baeza

[FIX] account: Problem rounding taxes when taxes are included in price.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account/account.py'
2--- account/account.py 2014-01-10 13:38:31 +0000
3+++ account/account.py 2014-02-12 08:29:35 +0000
4@@ -2322,8 +2322,7 @@
5 tax = {'name':'', 'amount':0.0, 'account_collected_id':1, 'account_paid_id':2}
6 one tax for each tax id in IDS and their children
7 """
8- if not precision:
9- precision = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')
10+ precision = self.pool.get('decimal.precision').precision_get(cr, uid, 'Account')
11 res = self._unit_compute_inv(cr, uid, taxes, price_unit, product, partner=None)
12 total = 0.0
13 for r in res: