From 26092e6972cedf3d11802c5d237e1d75f8f4358e Mon Sep 17 00:00:00 2001 From: "Paolo Gatti (pgi)" Date: Mon, 22 Apr 2024 10:59:35 +0200 Subject: [PATCH] [FIX] account: chart_template fiscal_position adjustement fix. PR odoo/odoo#157918 has a bug on commit 8bd8d4a3eaf. We cannot do `int(x) in Command` as it's TypeError. closes odoo/odoo#162786 Signed-off-by: Aliya Tastemirova (alta) --- addons/account/models/chart_template.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/account/models/chart_template.py b/addons/account/models/chart_template.py index d8739530f2c..c1a17b90227 100644 --- a/addons/account/models/chart_template.py +++ b/addons/account/models/chart_template.py @@ -542,8 +542,10 @@ class AccountChartTemplate(models.AbstractModel): if ( model == 'account.tax' and 'repartition_line_ids' in field_name and not self.ref(xml_id, raise_if_not_found=False) - and all(isinstance(x, tuple | list) for x in field_val) - and all(int(x[0]) in Command for x in field_val) + and all( + isinstance(x, tuple | list) and len(x) + and isinstance(x[0], Command | int) for x in field_val + ) ): field_val = [Command.clear()] + field_val to_be_removed.append(field_name)