Commit Graph
4 Commits
Author SHA1 Message Date
aktr-odoo 7a7d6d0353 [FIX] phone_validation: update phone number parsing for mauritius
When the user adds a valid Mauritius phone number, it is not correctly parsed by
the phonenumbers library, resulting in a user error while sending a WhatsApp
message to that number.

Steps to produce:

- Create a new contact with the Mauritius country selected.
- Add a phone number (e.g., '+23057654321').
- Try to send WhatsApp messages using this phone number.
- This will throw an Invalid number error.

Problem:

`phonenumbers==8.12.1` python library is used in odoo for parsing phone numbers.
The `8.12.1` version is too old and cannot parse Mauritius phone numbers
correctly.

Solution:

The `8.12.13` version accurately parses Mauritius phone numbers. Currently, The
latest version of the phonenumbers library is `8.13.31`. Hence, the latest code
from the latest version of the phonenumbers library is monkey-patched into the
system.

Task - 3799632

closes odoo/odoo#161039

X-original-commit: c3743b5fcfb5d67c442e5eee9f084b684e4baac3
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-04-09 15:06:51 +00:00
Antoine (ande) b49d5b7454 [FIX] phone_validation: panamas phone numbers
Current behavior:
Cannot send SMS to a partner that has
a mobile phone number from Panama.

Steps to reproduce:
parsed = phonenumbers.parse('6198 5462', region='PA')
is_valid = phonenumbers.is_valid_number(parsed)
is_valid == False

Cause of the issue:
Old versions of phonenumbers (external library) are not
updated to Panamas mobile phone numbers system change.

Fix:
Monkey patched the library
Similar as: https://github.com/odoo/odoo/commit/b21df8797141dac9f2cf0315658a08a238849f5b

opw-3682631

closes odoo/odoo#160885

X-original-commit: 1b6611f5d2d381ec53de8fce103759d6a5717d79
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-04-08 14:37:53 +00:00
Antoine (ande) 53885e4186 [FIX] phone_validation: brazilian phone numbers
Current behavior:
Brazilian phone numbers are not managed correctly
following the 2016 changes in Brazil.
(Adding a 9 to mobile phone numbers)

Fix:
Patched the phonenumbers library, adding a 9
at the right place for mobile phone numbers.

opw-3694150

closes odoo/odoo#159641

X-original-commit: a4f884456180769e0e7db7152d40ddcfb497b090
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-03-28 19:51:00 +00:00
Bruno-brsy 8629eccb96 [FIX] phone_validation: new convention number for Ivory Coast
Step to reproduce:

- Install contacts
- create a new contact and set "Côte d'Ivoire" as country
- add a phone number like this one: (+225) 01 02 03 04 05
- try to send a sms to the number, it's says "(Invalid number)" instead
  of the number, so it's not possible to send the SMS

The Ivory Coast has a new standard for the phone number since the 31
January 2021, the phone number can have a length of ten digits. And we
use the library phonenumbers with the version 8.9.10 and 8.8.1 for the
runbot and the SaaS server, but it's quite old (the 8.9.10 is released
on Jul 12 2018). The library in version 8.12.29 resolve the issue, but
using the recommended installation method, we would not have this
version.

opw-2726582

closes odoo/odoo#86742

X-original-commit: 2f718cd78feeafb82b2d11a58e1a518a69d52c5e
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Bruno-brsy <brsy@odoo.com>
2022-03-21 14:01:13 +01:00