Merge lp:~openerp-dev/openobject-addons/6.1-opw-579765-han into lp:openobject-addons/6.1

Proposed by Hardik Ansodariya (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-579765-han
Merge into: lp:openobject-addons/6.1
Diff against target: 20 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-579765-han
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+126868@code.launchpad.net

Description of the change

Hello,

fixed the issue of rounding in Taxes when compute taxes from invoice line.

1) create a new db with demo data and belgian localisation (l10n_be)
2) create sales invoice for customer Agrolait
3) add invoice line, no products, qty = 8, unit price = 15,63, discount = 40%, tax = VAT 21% (VAT-OUT-21-L)
4) click on 'Compute Taxes' and you have the problem : base amount = 75,04 - Untaxed amount = 75,02

with reference of Maintenance case: 579765

Thanks

To post a comment you must log in.
Revision history for this message
Niels Huylebroeck (red15) wrote :

Can I suggest making/altering the test scenario of the accounting module to be altered so these numbers will be tested there ? This way any rounding regressions on invoices can be caught very early.

Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

This bug was qualified as Not Reproducible on Trunk . If this Merge Proposal could not be merged in v6.1 at the release of v7.0, it will be closed.

Thanks,
Naresh Soni

Unmerged revisions

6984. By Hardik Ansodariya (OpenERP)

[FIX] account: Fix the problem of rounding in Taxes when compute taxes from invoice line (Maintanace case: 579765)

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-09-28 07:26:21 +0000
4@@ -1274,7 +1274,7 @@
5 res[line.id] = taxes['total']
6 if line.invoice_id:
7 cur = line.invoice_id.currency_id
8- res[line.id] = cur_obj.round(cr, uid, cur, res[line.id])
9+ res[line.id] = round(res[line.id],self.pool.get('decimal.precision').precision_get(cr, uid, 'Account'))
10 return res
11
12 def _price_unit_default(self, cr, uid, context=None):
13@@ -1586,7 +1586,6 @@
14
15 for line in inv.invoice_line:
16 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']:
17- tax['price_unit'] = cur_obj.round(cr, uid, cur, tax['price_unit'])
18 val={}
19 val['invoice_id'] = inv.id
20 val['name'] = tax['name']