Skip to content
Snippets Groups Projects
Commit 5154f405 authored by ijas ahammed's avatar ijas ahammed Committed by Thibault Delavallée
Browse files

[FIX] crm: do not propagate lead phone to partner if formatting differs

With a recent commit[1], we fixed the issue of false warning while changing
the partner on lead. But that fix ignored the fact that the lead has an
automatic formatting that may lead to false warning.

Right way to detect a phone number change is
  * lead phone is different from partner phone;
  * lead formatted phone is different from partner formatted phone;

If those two conditions are met we are quite sure numbers are different and
not only differs in their formatting.

In this commit we also fix inverse of phone number. When updating lead phone
value we have to use the same heuristic to update partner phone value. That
was we avoid unnecessary partner update when only formatting differs.

Tests are added to ensure new behavior and that ribbon message is effectively
trig erred with correct content.

LINKS

Task ID-2390287

[1] - https://github.com/odoo/odoo/commit/d29862c1de6208f7fdb7c8104afe0d35241d130b



closes odoo/odoo#62397

Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: default avatarIjas Ahammed <ija@odoo.com>
Co-authored-by: default avatarThibault Delavallée <tde@odoo.com>
parent 9b3c4d07
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment