Skip to content

[16.0] mail_gateway_whatsapp Phone number formatting issue requires +34 prefix #1744

@ljimenezsidoo

Description

@ljimenezsidoo

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:

  1. Set up a contact with a phone number in local format (e.g. 612345678, without +34).
  2. Try to send a message via the WhatsApp gateway.
  3. 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions