[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:
@@ -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:
|
||||
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user