[FIX] account: fix problem with round_globally method in tax calculation

When rounding globally, we should not round the tax with the currency rounding since it might introduce some errors.
Also add the field on the company view for user to change the computation method as they want.
This commit is contained in:
Cedric Snauwaert
2015-12-10 10:10:22 +01:00
parent d8e5cdec7d
commit 12dad00508
2 changed files with 5 additions and 1 deletions
+4 -1
View File
@@ -638,7 +638,10 @@ class AccountTax(models.Model):
continue
tax_amount = tax._compute_amount(base, price_unit, quantity, product, partner)
tax_amount = currency.round(tax_amount)
if company_id.tax_calculation_rounding_method == 'round_globally':
tax_amount = round(tax_amount, prec)
else:
tax_amount = currency.round(tax_amount)
if tax_amount:
if tax.price_include:
+1
View File
@@ -13,6 +13,7 @@
<field name="bank_account_code_prefix" groups="base.group_no_one"/>
<field name="cash_account_code_prefix" groups="base.group_no_one"/>
<field name="accounts_code_digits" groups="base.group_no_one"/>
<field name="tax_calculation_rounding_method" groups="base.group_no_one"/>
</xpath>
<notebook position="inside">
<page string="Overdue Payments">