From bbec2811a5dd7cf25fc03d43d50318814b27981c Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Mon, 28 Oct 2024 12:25:25 -0300 Subject: [PATCH] [FIX] l10n_br_cte_spec: fix post refactor multi-spec --- l10n_br_cte_spec/tests/test_cte_import.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/l10n_br_cte_spec/tests/test_cte_import.py b/l10n_br_cte_spec/tests/test_cte_import.py index 841af0e74b78..ef4f76d8159c 100644 --- a/l10n_br_cte_spec/tests/test_cte_import.py +++ b/l10n_br_cte_spec/tests/test_cte_import.py @@ -37,7 +37,7 @@ def build_attrs_fake(self, node, create_m2o=False): value = getattr(node, fname) if value is None: continue - key = f"cte40_{fspec.metadata.get('name', fname)}" + key = f"cte40_{fname}" if ( fspec.type == str or not any(["." in str(i) for i in fspec.type.__args__]) ) and not str(fspec.type).startswith("typing.List"): @@ -65,8 +65,12 @@ def build_attrs_fake(self, node, create_m2o=False): clean_type = binding_type.lower() comodel_name = f"cte.40.{clean_type.split('.')[-1]}" comodel = self.env.get(comodel_name) + if comodel is None: # example skip ICMS100 class - continue + comodel_name = f"cte.40.tcte_{clean_type.split('.')[-1]}" + comodel = self.env.get(comodel_name) + if comodel is None: + continue if not str(fspec.type).startswith("typing.List"): # m2o