[FIX] account_edi_ubl_cii: strip phone number ubl

Steps to reproduce:
[l10n_sa_edi]
- create a SA customer with phone number e.g.:`+971 56 777 7777`
- create an invoice
- Zatca Process it

Issue:
Error: "The Buyer’s contact phone number (BT-57) shall start with “0“ or “+”, followed by a maximum of 15 number and minimum 4 character after the “+“ or “0“ , if exist."

Solution:
For Saudi Arabia, it is not necessary to have the phone number.
For other locations, I assume that stripping the phone number could not harm the process.

opw-3666195

closes odoo/odoo#150495

X-original-commit: c8d93c7574f97ddd8924ed80031327db36c1c336
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Yolann Sabaux (yosa) <yosa@odoo.com>
This commit is contained in:
Yolann Sabaux
2024-01-23 09:47:23 +00:00
parent 2bb2349e49
commit 6e56b09573
@@ -66,10 +66,11 @@ class AccountEdiXmlUBL20(models.AbstractModel):
}]
def _get_partner_contact_vals(self, partner):
phone = partner.phone or partner.mobile
return {
'id': partner.id,
'name': partner.name,
'telephone': partner.phone or partner.mobile,
'telephone': phone and phone.strip(),
'electronic_mail': partner.email,
}