-
-
Notifications
You must be signed in to change notification settings - Fork 699
Description
mail_gateway_whatsapp
Describe the bug
In mail_gateway_whatsapp, if a phone number does not start with a +, the module removes the first character of the number. This breaks local numbers like 612345678 (Spain), which then become 12345678, resulting in a failed message delivery. As a result, users are forced to always include the full international format (e.g. +34).
To Reproduce
Affected versions: 16.0
Steps to reproduce the behavior:
- Set up a contact with a phone number in local format (e.g. 612345678, without +34).
- Try to send a message via the WhatsApp gateway.
- Odoo logs show a 400 Client Error. The response.request shows the number as 12345678 instead of 612345678.
Expected behavior
The module should implement proper phone number validation and formatting, rather than removing the first character. Ideally, it should:
Detect invalid formats and raise a warning, or
Attempt to format the number correctly based on region settings (if available).
Additional context
Is there any specific configuration required in Odoo to ensure proper number formatting before sending via the gateway?