[FIX] l10n_eg_edi_eta: send invoices with individual partner

Before the fix it was not possible to create an invoice with an individual partner
and send it to the government. The 'type' of the receiver is a required property
to send to the government. There is no mention of it being optional in the API
(https://sdk.invoicing.eta.gov.eg/documents/invoice-v1-0/#receiver).

Now it's possible to send such invoice and the 'type' of the receiver is always sent.

opw-2979515

closes odoo/odoo#103053

X-original-commit: 832fcfa708e014741fe244fd48a0c89f0a18863c
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Beckers Thomas (tbs) <tbs@odoo.com>
This commit is contained in:
Thomas Beckers
2022-10-11 16:57:11 +02:00
parent ea9c886595
commit cd9eea7c9c
@@ -299,8 +299,8 @@ class AccountEdiFormat(models.Model):
if issuer:
address['address']['branchID'] = invoice.journal_id.l10n_eg_branch_identifier or ''
individual_type = self._l10n_eg_get_partner_tax_type(partner, issuer)
address['type'] = individual_type or ''
if invoice.amount_total >= invoice.company_id.l10n_eg_invoicing_threshold or individual_type != 'P':
address['type'] = individual_type or ''
address['id'] = partner.vat or ''
return address