Skip to content

Commit

Permalink
[FIX] l10n_br_cte_spec: fix post refactor multi-spec
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelsavegnago committed Oct 28, 2024
1 parent f543dbb commit bbec281
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions l10n_br_cte_spec/tests/test_cte_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bbec281

Please sign in to comment.