-
-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[14.0][MIG] Migration to 14.0 l10n_it_fatturapa_out_fd
- Loading branch information
1 parent
1fb69e2
commit 499801c
Showing
8 changed files
with
48 additions
and
38 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
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
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
32 changes: 16 additions & 16 deletions
32
l10n_it_fatturapa_out_fd/wizards/wizard_export_fatturapa.py
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,25 +1,25 @@ | ||
# Copyright 2023 Simone Rubino - TAKOBI | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import models | ||
from odoo.addons.l10n_it_fatturapa.bindings.fatturapa import ( | ||
ScontoMaggiorazioneType, | ||
TipoScontoMaggiorazioneType, | ||
) | ||
from odoo.tools import float_round | ||
from odoo import api, models | ||
|
||
|
||
class WizardExportFatturapa (models.TransientModel): | ||
class WizardExportFatturapa(models.TransientModel): | ||
_inherit = "wizard.export.fatturapa" | ||
|
||
def setScontoMaggiorazione(self, line): | ||
res = super().setScontoMaggiorazione(line) | ||
@staticmethod | ||
def get_importo(line): | ||
discount_fixed = line.discount_fixed | ||
if discount_fixed: | ||
res.append( | ||
ScontoMaggiorazioneType( | ||
Tipo=TipoScontoMaggiorazioneType.SC, | ||
Importo='%.2f' % float_round(discount_fixed, 8), | ||
) | ||
) | ||
return res | ||
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 |
1 change: 1 addition & 0 deletions
1
setup/l10n_it_fatturapa_out_fd/odoo/addons/l10n_it_fatturapa_out_fd
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../l10n_it_fatturapa_out_fd |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |