Skip to content

Commit

Permalink
[FIX] l10n_it_fatturapa_out_stamp: Bollo precision must be 2 (OCA#774) (
Browse files Browse the repository at this point in the history
  • Loading branch information
SimoRubi authored and Borruso committed Feb 17, 2023
1 parent d95a31e commit cb3e71c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion l10n_it_fatturapa_out_stamp/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Italian Localization - Fattura elettronica - Integrazione bollo",
"summary": "Modulo ponte tra emissione fatture elettroniche e imposta di "
"bollo",
"version": "12.0.1.0.0",
"version": "12.0.1.0.1",
"development_status": "Beta",
"category": "Hidden",
"website": "https://github.com/OCA/l10n-italy",
Expand Down
9 changes: 2 additions & 7 deletions l10n_it_fatturapa_out_stamp/wizard/wizard_export_fatturapa.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,13 @@ def setDatiGeneraliDocumento(self, invoice, body):
res = super(WizardExportFatturapa, self).setDatiGeneraliDocumento(
invoice, body)
if invoice.tax_stamp:
price_precision = self.env['decimal.precision'].precision_get(
'Product Price')
if price_precision < 2:
price_precision = 2
if not invoice.company_id.tax_stamp_product_id:
raise UserError(_(
"Tax Stamp Product not set for company %s"
) % invoice.company_id.name)
stamp_price = invoice.company_id.tax_stamp_product_id.list_price
body.DatiGenerali.DatiGeneraliDocumento.DatiBollo = DatiBolloType(
BolloVirtuale="SI",
ImportoBollo=('%.' + str(
price_precision
) + 'f') % invoice.company_id.tax_stamp_product_id.list_price,
ImportoBollo='%.2f' % stamp_price,
)
return res

0 comments on commit cb3e71c

Please sign in to comment.