summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/models/thread_cache/thread_cache.js
diff options
context:
space:
mode:
authorThibault Francois <tfr@openerp.com>2020-07-30 11:24:30 +0000
committerThibault Delavallée <tde@odoo.com>2020-08-13 07:43:28 +0000
commit6ea7a9a975225c08a384567d5ddb05213df0dde4 (patch)
treeb0dbc512e71d3095caca9c4b9d7d5d41af0fa003 /addons/mail/static/src/models/thread_cache/thread_cache.js
parent0158fd90f7f402a3104bfafed6ed3770c6a4fa68 (diff)
[FIX] crm_lead: improve synchronization between lead and partner_id
PURPOSE Distinguish synchronization of partner values on lead: address fields (all or none), classic fields (propagate if set) and special cases (names-alike). SPECIFICATIONS Follow up of https://github.com/odoo/odoo/commit/f8179007f9aa662be7318edeb18426ea1c906c15 Context: many fields are now synchronized from the partner_id: address fields as well as other contact fields. A first commit 9c9f477f04e8f4ee9b18092fe894890c2ab31b58 kept the value from the lead if the value from the partner was empty. This lead to mixed address fields. A second commit fixed that behavior f8179007f9aa662be7318edeb18426ea1c906c15 by taking the value from the partner only when it was set. Problem: This erases too much information. ``` >>> lead.partner_name 'testtest' >>> partner_id.name 'testtest@mailinator.com' >>> partner_id.parent_id res.partner() >>> partner_id.is_company False >>> lead.write({'partner_id': partner_id.id}) >>> lead.partner_name False ``` We indeed need a consistent address but for the other fields we want to keep the maximum of data. SOLUTION For the address fields, take all the values from the partner if one of the address fields is defined, otherwise keep the information defined on the lead. For all the other fields keep the lead information if the partner information is empty. LINKS Task ID-2316828 PR #55825 X-original-commit https://github.com/odoo/odoo/pull/55194/commits/f53fba6663a34e8e6b13354dde3dc225f5814de3 X-original-PR #55194 X-original-commit: b136df8530279a54c9be96beeea9bdda01643000
Diffstat (limited to 'addons/mail/static/src/models/thread_cache/thread_cache.js')
0 files changed, 0 insertions, 0 deletions