-
-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[14.0][IMP] l10n_it_fatturapa_out_rc: make template data overridable
- Loading branch information
Showing
4 changed files
with
16 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
from . import efattura | ||
from . import wizard_export_fatturapa |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,13 @@ | ||
# Copyright 2021 Alex Comba - Agile Business Group | ||
# Copyright 2022 Marco Colombo - Phi srl - <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import api, models | ||
|
||
from .efattura import EFatturaOut | ||
|
||
|
||
class WizardExportFatturapa(models.TransientModel): | ||
_inherit = "wizard.export.fatturapa" | ||
|
||
@api.model | ||
def _get_efattura_class(self): | ||
return EFatturaOut | ||
|
||
@api.model | ||
def getSign(self, invoice): | ||
sign = 1 | ||
|
@@ -23,6 +18,21 @@ def getSign(self, invoice): | |
sign = -1 | ||
return sign | ||
|
||
@api.model | ||
def getTemplateValues(self, template_values): | ||
template_values = super().getTemplateValues(template_values) | ||
template_values.update({"get_sign": self.getSign}) | ||
return template_values | ||
|
||
@api.model | ||
def getPayments(self, invoice): | ||
payments = super().getPayments(invoice) | ||
sign = self.getSign(invoice) | ||
for payment in payments: | ||
payment.amount_currency *= sign | ||
payment.debit *= sign | ||
return payments | ||
|
||
@api.model | ||
def getImportoTotale(self, invoice): | ||
amount_total = super().getImportoTotale(invoice) | ||
|