[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) <las@odoo.com>
Signed-off-by: Aliya Tastemirova (alta) <alta@odoo.com>
This commit is contained in:
aliya
2024-03-22 13:02:02 +00:00
parent bde46a0b17
commit aef34b5594
2 changed files with 8 additions and 1 deletions
@@ -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
+1 -1
View File
@@ -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: