openerp-india team mailing list archive
-
openerp-india team
-
Mailing list archive
-
Message #16096
[Bug 1058390] Re: Wrong base amount of taxes in OpenERP 6.1
** Patch added: "Patch that fixes the bug"
https://bugs.launchpad.net/bugs/1058390/+attachment/3353602/+files/fix-base-tax-bug.diff
--
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1058390
Title:
Wrong base amount of taxes in OpenERP 6.1
Status in OpenERP Addons (modules):
New
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_accountant"
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://bazaar.launchpad.net/~openerp
/openobject-addons/6.1/revision/5569. This commit was designed to fix
this bug : https://launchpad.net/bugs/887367. I have tested the
scenario of this bug report to see if my code re-introduces this bug ;
it's not the case.
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1058390/+subscriptions
References