Skip to content

Commit

Permalink
[IMP] inherit from wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiocorato committed Oct 24, 2024
1 parent 508e015 commit 100ea0f
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions l10n_it_fatturapa_out_fd/wizards/wizard_export_fatturapa.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,10 @@
class WizardExportFatturapa(models.TransientModel):
_inherit = "wizard.export.fatturapa"

@staticmethod
def get_importo(line):
@api.model
def getImporto(self, line):
res = super().getImporto(line)
discount_fixed = line.discount_fixed
if discount_fixed:
return discount_fixed
str_number = str(line.discount)
number = str_number[::-1].find(".")
if number <= 2:
return False
return line.price_unit * line.discount / 100

@api.model
def getTemplateValues(self, template_values):
template_values = super().getTemplateValues(template_values)
template_values.update({"get_importo": self.get_importo})
return template_values
return res

0 comments on commit 100ea0f

Please sign in to comment.