Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion l10n_it_fatturapa_out/data/invoice_it_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ e 'line' per riga di fattura (a seconda del livello in cui sono chiamati)
<Quantita t-out="format_quantity(line)" />
<UnitaMisura
t-if="line.product_uom_id.name"
t-out="unidecode(line.product_uom_id.name)"
t-out="to_basiclatin(line.product_uom_id.name)"
/>
<!-- <DataInizioPeriodo t-out=""/>-->
<!-- <DataFinePeriodo t-out=""/>-->
Expand Down
11 changes: 9 additions & 2 deletions l10n_it_fatturapa_out/wizard/efattura.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# Copyright 2020 Marco Colombo
import logging
import os
import unicodedata
from datetime import datetime

from lxml import etree
from unidecode import unidecode

from odoo.exceptions import UserError
from odoo.tools import float_repr
Expand Down Expand Up @@ -222,6 +222,13 @@ def fpa_to_eur(amount, invoice, rate=None):
euro = self.env.ref("base.EUR")
return fpaToEur(amount, invoice, euro, rate)

def to_basiclatin(s):
return (
unicodedata.normalize("NFKD", s)
.encode("ascii", "ignore")
.decode("ascii")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to_basiclatin non dovrebbe codificare con latin invece che ascii?

)

if self.partner_id.commercial_partner_id.is_pa:
# check value code
code = self.partner_id.ipa_code
Expand Down Expand Up @@ -249,7 +256,7 @@ def fpa_to_eur(amount, invoice, rate=None):
"get_id_fiscale_iva": get_id_fiscale_iva,
"codice_destinatario": code.upper(),
"in_eu": in_eu,
"unidecode": unidecode,
"to_basiclatin": to_basiclatin,
"wizard": self.wizard,
"get_importo": get_importo,
"get_importo_totale": get_importo_totale,
Expand Down