Skip to content

Commit 46c40b0

Browse files
committed
[12.0][IMP] importo bollo non più obbligatorio e-invoice 1.6
1 parent b78b69f commit 46c40b0

2 files changed

Lines changed: 8 additions & 11 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
* Lorenzo Battistini <https://github.com/eLBati>
2+
* Sergio Corato <https://github.com/sergiocorato>

l10n_it_fatturapa_out_stamp/wizard/wizard_export_fatturapa.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
33

44
from odoo import models
5-
from odoo.tools.translate import _
6-
from odoo.exceptions import UserError
7-
from odoo.tools.float_utils import float_round
5+
from odoo.tools.float_utils import float_round, float_is_zero
86
from odoo.addons.l10n_it_fatturapa.bindings.fatturapa import (
97
DatiBolloType
108
)
@@ -17,13 +15,11 @@ def setDatiGeneraliDocumento(self, invoice, body):
1715
res = super(WizardExportFatturapa, self).setDatiGeneraliDocumento(
1816
invoice, body)
1917
if invoice.tax_stamp:
20-
if not invoice.company_id.tax_stamp_product_id:
21-
raise UserError(_(
22-
"Tax Stamp Product not set for company %s"
23-
) % invoice.company_id.name)
24-
stamp_price = invoice.company_id.tax_stamp_product_id.list_price
2518
body.DatiGenerali.DatiGeneraliDocumento.DatiBollo = DatiBolloType(
26-
BolloVirtuale="SI",
27-
ImportoBollo='%.2f' % float_round(stamp_price, 2),
28-
)
19+
BolloVirtuale="SI")
20+
if invoice.company_id.tax_stamp_product_id:
21+
stamp_price = invoice.company_id.tax_stamp_product_id.list_price
22+
if not float_is_zero(stamp_price, precision_digits=2):
23+
body.DatiGenerali.DatiGeneraliDocumento.DatiBollo.ImportoBollo = \
24+
'%.2f' % float_round(stamp_price, 2)
2925
return res

0 commit comments

Comments
 (0)