Merge PR #1376 into 14.0

Signed-off-by pedrobaeza
This commit is contained in:
OCA-git-bot
2023-07-11 18:45:50 +00:00

View File

@@ -462,7 +462,9 @@ class WizardUpdateChartsAccounts(models.TransientModel):
def find_taxes_by_templates(self, templates): def find_taxes_by_templates(self, templates):
tax_ids = [] tax_ids = []
for tax in templates: for tax in templates:
tax_ids.append(self.find_tax_by_templates(tax)) tax_id = self.find_tax_by_templates(tax)
if tax_id:
tax_ids.append(tax_id)
return self.env["account.tax"].browse(tax_ids) return self.env["account.tax"].browse(tax_ids)
@tools.ormcache("templates") @tools.ormcache("templates")
@@ -562,6 +564,7 @@ class WizardUpdateChartsAccounts(models.TransientModel):
) )
) )
if tax.amount_type != "group":
# Mark to be removed the lines not found # Mark to be removed the lines not found
remove_ids = [x for x in current_repartition.ids if x not in existing_ids] remove_ids = [x for x in current_repartition.ids if x not in existing_ids]
result += [(2, x) for x in remove_ids] result += [(2, x) for x in remove_ids]