Skip to content

Commit

Permalink
[FIX] l10n_es_edi_sii: partners without vat should work as well
Browse files Browse the repository at this point in the history
Before, the system required a vat number on every partner, but that
is not required.  We need to send it as some other kind of ID however.

To clarify, a partner without vat is not for the simplified case only.

closes odoo#81931

X-original-commit: 2b164b8
Signed-off-by: Laurent Smet <las@odoo.com>
  • Loading branch information
jco-odoo committed Dec 28, 2021
1 parent 0c2fe0d commit 32dccc9
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions addons/l10n_es_edi_sii/models/account_edi_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def _l10n_es_edi_get_partner_info(self, partner):
if (not partner.country_id or partner.country_id.code == 'ES') and partner.vat:
# ES partner with VAT.
partner_info['NIF'] = partner.vat[2:] if partner.vat.startswith('ES') else partner.vat
elif partner.country_id.code in eu_country_codes:
elif partner.country_id.code in eu_country_codes and partner.vat:
# European partner.
partner_info['IDOtro'] = {'IDType': '02', 'ID': IDOtro_ID}
else:
Expand Down Expand Up @@ -599,8 +599,6 @@ def _check_move_configuration(self, move):

if not move.company_id.vat:
res.append(_("VAT number is missing on company %s", move.company_id.display_name))
if not move.partner_id.vat:
res.append(_("VAT number needs to be configured on the partner %s", move.partner_id.display_name))
for line in move.invoice_line_ids.filtered(lambda line: not line.display_type):
taxes = line.tax_ids.flatten_taxes_hierarchy()
recargo_count = taxes.mapped('l10n_es_type').count('recargo')
Expand Down

0 comments on commit 32dccc9

Please sign in to comment.