Skip to content
Snippets Groups Projects
Commit 56214259 authored by Paolo Gatti's avatar Paolo Gatti
Browse files

[FIX] l10n_it_edi: Non EU VAT fix

Non EU vendor bills are sent to the Tax Agency as self-invoices,
so the partner actually is the seller, but the same checks on the
VAT must apply as it was the buyer.

Task: https://www.odoo.com/web#id=3010849&model=project.task


opw-3010849

closes odoo/odoo#106303

X-original-commit: 8c18b870
Signed-off-by: default avatarJosse Colpaert <jco@odoo.com>
Signed-off-by: default avatarPaolo Gatti (pgi) <pgi@odoo.com>
parent c98e1280
No related branches found
No related tags found
No related merge requests found
......@@ -58,10 +58,18 @@
</DatiTrasmissione>
<CedentePrestatore>
<DatiAnagrafici>
<IdFiscaleIVA>
<IdFiscaleIVA t-if="seller.vat and in_eu(seller)">
<IdPaese t-esc="get_vat_country(seller.vat)"/>
<IdCodice t-esc="get_vat_number(seller.vat)"/>
</IdFiscaleIVA>
<IdFiscaleIVA t-if="seller.vat and not in_eu(seller)">
<IdPaese t-esc="seller.country_id.code"/>
<IdCodice t-esc="'OO99999999999'"/>
</IdFiscaleIVA>
<IdFiscaleIVA t-if="not seller.vat and seller.country_id.code != 'IT'">
<IdPaese t-esc="seller.country_id.code"/>
<IdCodice t-esc="'0000000'"/>
</IdFiscaleIVA>
<CodiceFiscale t-if="seller.l10n_it_codice_fiscale" t-esc="normalize_codice_fiscale(seller.l10n_it_codice_fiscale)"/>
<Anagrafica>
<Denominazione t-esc="format_alphanumeric(seller_partner.display_name[:80])"/>
......
......@@ -96,9 +96,9 @@ class AccountEdiFormat(models.Model):
errors.append(_("%s must have a country", seller.display_name))
# <1.1.1.2>
if not seller.vat:
if not invoice.company_id.vat:
errors.append(_("%s must have a VAT number", seller.display_name))
elif len(seller.vat) > 30:
if seller.vat and len(seller.vat) > 30:
errors.append(_("The maximum length for VAT number is 30. %s have a VAT number too long: %s.", seller.display_name, seller.vat))
# <1.2.1.2>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment