From 6e56b095731bd1c69a2e613780be857939c19d56 Mon Sep 17 00:00:00 2001 From: Yolann Sabaux Date: Thu, 4 Jan 2024 14:23:00 +0100 Subject: [PATCH] [FIX] account_edi_ubl_cii: strip phone number ubl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) Signed-off-by: Yolann Sabaux (yosa) --- addons/account_edi_ubl_cii/models/account_edi_xml_ubl_20.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_20.py b/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_20.py index 5c0dcaf870c..008f4a54356 100644 --- a/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_20.py +++ b/addons/account_edi_ubl_cii/models/account_edi_xml_ubl_20.py @@ -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, }