Wrong base amount of taxes in OpenERP 6.1
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Released
|
Undecided
|
OpenERP Publisher's Warranty Team | |||
Therp Backports (Deprecated) | Status tracked in Addons-6.1 | |||||
Addons-6.1 |
Fix Released
|
High
|
Ronald Portier (Therp) |
Bug Description
Anevia has discovered that OpenERP 6.1 doesn't compute correctly the "base" amount of taxes ; as surprising as it may seem, the tax amount is correct.
This bug is present in OpenERP 6.1 (not in OpenERP 6.0) with an up-to-date codebase.
Here is a detailed scenario to reproduce the bug :
1. Create a new DB with demo data
2. Install the module "account_
3. Activate "Extended view"
4. Create a new customer invoice for the partner Agrolait in EUR currency
Add an invoice line with :
- Product = HDD1 (could be any)
- Quantity = 100
- Unit price = 0.56
- Discount = 15%
(if you have a tax, check that it's NOT a "tax included" one)
5. Click on compute tax : you will see that :
* The total untaxed amount of the invoice is 47.60
* At the bottom left, in the invoice tax lines, there is one line ; in this line, the "base" amount is 48.00 !
=> These two amounts should be identical ; that's the bug.
The cause of the bug is the following :
* the "price_subtotal" of the invoice line is computed that way :
1. (quantity * unit price) * (1-discount/100) = 47.60000 (cf line 1272 of account_invoice.py)
2. Round at the precision of the EUR currency = 47.60 (cf line 1277 of account_invoice.py)
* but the "base" amount of the invoice tax line is not computed the same way :
1. price_unit * (1-discount / 100) = 0.47600 (cf line 1588 of account_invoice.py)
2. Round at the precision of the EUR currency = 0.48 (cf line 1589 of account_invoice.py)
3. Multiply by the quantity : 0.48 x 100 = 48.0 (cf line 1596 of account_invoice.py)
I have written a patch that makes OpenERP compute the "base" amount of invoice tax lines with the same method as the "price_subtotal" of the invoice line. I enclose the patch to this bug report.
In fact, this bug was introduced in the branch addons-6.1 by the commit 5569 dated 2011-11-10, cf http://
Related branches
- Naresh(OpenERP): Pending requested
-
Diff: 19 lines (+1/-2)1 file modifiedaccount/account_invoice.py (+1/-2)
- Stefan Rijnhart (Opener) (community): Approve
-
Diff: 19 lines (+1/-2)1 file modifiedaccount/account_invoice.py (+1/-2)
Changed in openobject-addons: | |
assignee: | nobody → OpenERP Publisher's Warranty Team (openerp-opw) |
tags: | added: maintenance |
Changed in therp-backports: | |
assignee: | nobody → Ronald Portier (Therp) (rportier1962) |
importance: | Undecided → High |
merged in trunk.
Thanks for the very good contribution :)