odoo/odoo#163691

Created by fw-bot
label
odoo-dev:master-15.0-opw-3845645-fix_sa_foreign_edi_warning-pta-hl_h-fw
head
cc4770037e67eb7ec85193b996b289aa941431b4
target
master
merged
3 weeks ago by Anh Thao Pham (pta)
forward-port of
odoo/odoo#162809

[FW][FIX] l10n_sa_edi: fix scheme ID for foreign customers

**Steps to reproduce:**
- Install Contacts, Accounting and l10n_sa_edi
- Switch to a Saudi Arabian company (e.g. SA Company)
- Create a contact who is not in Saudi Arabia:
* Address: [Complete address in United Arab Emirates]
* VAT: [any]
- Create an invoice:
* Customer: [The created contact]
* Product: [any]
- Confirm the invoice
- Process by ZATCA

**Issue:**
The following warning is returned:
"The other Buyer ID (BT-46) must present in the tax invoice and associated debit notes and credit notes (KSA-2, position 1 and 2 = 01), where the buyer VAT registration number or buyer group VAT registration number (BT-48) is not provided."

**Cause:**
"PartyIdentification" element is not set in the electronic invoice for customer because he doesn't have "l10n_sa_additional_identification_number" field set.
This field is only available for contacts living in Saudi Arabia.
For contacts who don't live in Saudi Arabia, "PartyIdentification" should be populate with their VAT number.

opw-3845645



---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

Forward-Port-Of: odoo/odoo#162809