Skip to content

Commit

Permalink
l10n_fr_intrastat_product: no regime 29 for standard reporting level
Browse files Browse the repository at this point in the history
  • Loading branch information
alexis-via committed Nov 30, 2023
1 parent b2a04bf commit 1b6a2cd
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,13 @@ def _update_computation_line_vals(self, inv_line, line_vals, notedict):
if invoice.intrastat_fiscal_position == "b2b":
regime_code = 21
elif invoice.intrastat_fiscal_position == "b2c":
regime_code = 29
# 29 is only for EMEBI (extended),
# not for the fiscal declaration (standard)
if self.reporting_level == "standard":
line_vals.clear()
return

Check warning on line 134 in l10n_fr_intrastat_product/models/intrastat_product_declaration.py

View check run for this annotation

Codecov / codecov/patch

l10n_fr_intrastat_product/models/intrastat_product_declaration.py#L133-L134

Added lines #L133 - L134 were not covered by tests
else:
regime_code = 29

Check warning on line 136 in l10n_fr_intrastat_product/models/intrastat_product_declaration.py

View check run for this annotation

Codecov / codecov/patch

l10n_fr_intrastat_product/models/intrastat_product_declaration.py#L136

Added line #L136 was not covered by tests
if regime_code:
regime = self.env.ref(
"l10n_fr_intrastat_product.fr_regime_%d" % regime_code
Expand Down Expand Up @@ -211,8 +217,7 @@ def _generate_xml(self):
line += 1 # increment line number
pline._generate_xml_line(declaration, eu_countries, line)

objectify.deannotate(root, xsi_nil=True)
etree.cleanup_namespaces(root)
objectify.deannotate(root, xsi_nil=True, cleanup_namespaces=True)

Check warning on line 220 in l10n_fr_intrastat_product/models/intrastat_product_declaration.py

View check run for this annotation

Codecov / codecov/patch

l10n_fr_intrastat_product/models/intrastat_product_declaration.py#L220

Added line #L220 was not covered by tests
xml_bytes = etree.tostring(
root, pretty_print=True, encoding="UTF-8", xml_declaration=True
)
Expand Down

0 comments on commit 1b6a2cd

Please sign in to comment.