From cd9eea7c9c427af898a6ec26454f6620fc3ccf9d Mon Sep 17 00:00:00 2001 From: Thomas Beckers Date: Fri, 7 Oct 2022 13:44:09 +0000 Subject: [PATCH] [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 Signed-off-by: Beckers Thomas (tbs) --- addons/l10n_eg_edi_eta/models/account_edi_format.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/l10n_eg_edi_eta/models/account_edi_format.py b/addons/l10n_eg_edi_eta/models/account_edi_format.py index d2b5c192754..fcec8db1937 100644 --- a/addons/l10n_eg_edi_eta/models/account_edi_format.py +++ b/addons/l10n_eg_edi_eta/models/account_edi_format.py @@ -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