[sale_tax_include][account_tax_include] rounding error on taxed amount
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Won't Fix
|
Medium
|
Unassigned |
Bug Description
I have a bug with account_tax_includ and sale_tax_include (purchase_
Create a new product with 9€ for the price and a include VAT tax of 19,6% (ex : sale French VAT)
Create a new sale order (or a new invoice, it's the same bug)
And add the product
Compute taxe
And... the result is
untaxed amount : 7,53€
taxed amount : 1,48€
total amount : 9,01€ !!!
The problem is simply, OpenERP have made a round on temporary untaxed amount :
untaxed amount = 9/1,196 = 7,525083612 ==> 7,53€
taxed amount = 7,53x1,196 = 9,00588 ==> 9,01€
So 9,00 = 9,01 ;)
The solution is to not round the tempory value of untaxed amount :
untaxed amount = 9/1,196 = 7,525083612
taxed amount = 7,525083612x1,196 = 9€
After calculating the taxe untaxe amount can be rounded without problem.
Moreover before returning value of untaxe amount and total amount are rounded (line 89-90)
I join a patch, if you disagree with the idea of deleting the round option in compute_inv, maybe we can add a optional parameter to compute_inv method to choose if we want a rounding value of tax amount or not; in the case of sale_tax_include and account_tax_include the optional parameter will be use to disable the rounding funtion.
Changed in openobject-addons: | |
importance: | Undecided → Medium |
Changed in openobject-addons: | |
status: | New → Confirmed |
Hello Sebastien,
Are you sure this happens at your end?
I made Invoice and SO with the same configuration: I get 7.53,1.47 and 9.00.
Can you recheck? I checked with price_accuracy 2 3 4 too.
Thanks.