From aef34b559451fa89e814bc0bb48ea80bf7c462d8 Mon Sep 17 00:00:00 2001 From: aliya Date: Tue, 19 Mar 2024 16:36:40 +0100 Subject: [PATCH] [FIX] account_peppol: update phonenumbers error message If phonenumbers library is not installed, we should display a relevant error message, instead of the generic invalid phone number error message. closes odoo/odoo#154926 closes odoo/odoo#158546 Signed-off-by: Laurent Smet (las) Signed-off-by: Aliya Tastemirova (alta) --- addons/account_peppol/i18n/account_peppol.pot | 7 +++++++ addons/account_peppol/models/res_company.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/addons/account_peppol/i18n/account_peppol.pot b/addons/account_peppol/i18n/account_peppol.pot index 57d3654c5ac..a7791adcede 100644 --- a/addons/account_peppol/i18n/account_peppol.pot +++ b/addons/account_peppol/i18n/account_peppol.pot @@ -554,6 +554,13 @@ msgstr "" msgid "Please fill in the EAS code and the Participant ID code." msgstr "" +#. module: account_peppol +#. odoo-python +#: code:addons/account_peppol/models/res_company.py:0 +#, python-format +msgid "Please install the phonenumbers library." +msgstr "" + #. module: account_peppol #. odoo-python #: code:addons/account_peppol/wizard/account_move_send.py:0 diff --git a/addons/account_peppol/models/res_company.py b/addons/account_peppol/models/res_company.py index f2f52ea26d3..acf0e94f7f4 100644 --- a/addons/account_peppol/models/res_company.py +++ b/addons/account_peppol/models/res_company.py @@ -82,7 +82,7 @@ class ResCompany(models.Model): "Currently, only European countries are supported.") if not phonenumbers: - raise ValidationError(error_message) + raise ValidationError(_("Please install the phonenumbers library.")) phone_number = phone_number or self.account_peppol_phone_number if not phone_number: