2
0

[IMP] account_chart_update: improve extensibility

This commit is contained in:
Lois Rilo 2022-10-24 13:28:50 +02:00 committed by Luis J. Salvatierra
parent 8172b7158a
commit c630022abf

View File

@ -778,6 +778,13 @@ class WizardUpdateChartsAccounts(models.TransientModel):
]
)
def _domain_taxes_to_deactivate(self, found_taxes_ids):
return [
("company_id", "=", self.company_id.id),
("id", "not in", found_taxes_ids),
("active", "=", True),
]
def _find_taxes(self):
"""Search for, and load, tax templates to create/update/delete."""
found_taxes_ids = []
@ -821,11 +828,7 @@ class WizardUpdateChartsAccounts(models.TransientModel):
# search for taxes not in the template and propose them for
# deactivation
taxes_to_deactivate = self.env["account.tax"].search(
[
("company_id", "=", self.company_id.id),
("id", "not in", found_taxes_ids),
("active", "=", True),
]
self._domain_taxes_to_deactivate(found_taxes_ids)
)
for tax in taxes_to_deactivate:
self.tax_ids.create(