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
=== modified file 'account/account_invoice.py'
--- account/account_invoice.py 2012-08-20 15:52:57 +0000
+++ account/account_invoice.py 2012-09-28 07:26:21 +0000
@@ -1274,7 +1274,7 @@
1274 res[line.id] = taxes['total']1274 res[line.id] = taxes['total']
1275 if line.invoice_id:1275 if line.invoice_id:
1276 cur = line.invoice_id.currency_id1276 cur = line.invoice_id.currency_id
1277 res[line.id] = cur_obj.round(cr, uid, cur, res[line.id])1277 res[line.id] = round(res[line.id],self.pool.get('decimal.precision').precision_get(cr, uid, 'Account'))
1278 return res1278 return res
12791279
1280 def _price_unit_default(self, cr, uid, context=None):1280 def _price_unit_default(self, cr, uid, context=None):
@@ -1586,7 +1586,6 @@
15861586
1587 for line in inv.invoice_line:1587 for line in inv.invoice_line:
1588 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']:1588 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']:
1589 tax['price_unit'] = cur_obj.round(cr, uid, cur, tax['price_unit'])
1590 val={}1589 val={}
1591 val['invoice_id'] = inv.id1590 val['invoice_id'] = inv.id
1592 val['name'] = tax['name']1591 val['name'] = tax['name']