diff --git a/addons/account/models/account_tax.py b/addons/account/models/account_tax.py
index afa0e44a540..c85143e863b 100644
--- a/addons/account/models/account_tax.py
+++ b/addons/account/models/account_tax.py
@@ -641,12 +641,12 @@ class AccountTaxRepartitionLine(models.Model):
help="The order in which distribution lines are displayed and matched. For refunds to work properly, invoice distribution lines should be arranged in the same order as the credit note distribution lines they correspond to.")
use_in_tax_closing = fields.Boolean(string="Tax Closing Entry")
- @api.onchange('account_id')
+ @api.onchange('account_id', 'repartition_type')
def _on_change_account_id(self):
- if not self.account_id:
+ if not self.account_id or self.repartition_type == 'base':
self.use_in_tax_closing = False
else:
- self.use_in_tax_closing = not(self.account_id.internal_group == 'income' or self.account_id.internal_group == 'expense')
+ self.use_in_tax_closing = self.account_id.internal_group not in ('income', 'expense')
@api.constrains('invoice_tax_id', 'refund_tax_id')
def validate_tax_template_link(self):
diff --git a/addons/account/views/account_tax_views.xml b/addons/account/views/account_tax_views.xml
index 74e78d3e6e8..26862d825bd 100644
--- a/addons/account/views/account_tax_views.xml
+++ b/addons/account/views/account_tax_views.xml
@@ -28,7 +28,9 @@
-
+