Skip to content

Commit

Permalink
[REF] l10n_it_fatturapa_in_rc: Allow to override RC line detection
Browse files Browse the repository at this point in the history
  • Loading branch information
SirAionTech committed Jun 19, 2024
1 parent a5c256b commit f076575
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion l10n_it_fatturapa_in_rc/wizard/wizard_import_fatturapa.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@
class WizardImportFatturapa(models.TransientModel):
_inherit = "wizard.import.fatturapa"

def _is_in_reverse_charge_line(self, line):
"""The e-invoice line `line` should be imported as reverse charge."""
return float(line.AliquotaIVA) == 0.0 and line.Natura.startswith("N6")

def _prepare_generic_line_data(self, line):
retLine = {}
account_tax_model = self.env["account.tax"]
if float(line.AliquotaIVA) == 0.0 and line.Natura.startswith("N6"):
if self._is_in_reverse_charge_line(line):
# search reversed tax
account_rc_type_tax = self.env["account.rc.type.tax"].search(
[("rc_type_id.e_invoice_suppliers", "=", True)]
Expand Down

0 comments on commit f076575

Please sign in to comment.