Odoo's Mergebot 0b2a8f5ba0 [FW][FIX] crm: avoid spurious date_open/last_stage_update
Before this commit:
  * when a user changes 'user_id' to set the same previous 'user_id', the
    assign date 'date_open' is updated but it should not as the responsible
    did not change;
  * when a user changes the salesperson 'user_id' of a crm lead, it triggers
    a recompute of 'team_id' that triggers a recompute of 'stage_id' that
    updates  'date_last_stage_update' even if the stage does not change, which
    happens frequently when changing leads within a given team (new assign,
    salesperson on holidays, ...)
  * when merging opportunities, 'user_id' can be set on the main opportunity
    which triggers a recomputation of both 'date_last_stage_update' and
    'date_open' as explained in above points;

Reason:
The 'date_last_stage_update' field depends on 'stage_id' which depends on
'team_id' which depends on 'user_id'. As a result, when 'user_id' changes,
'date_last_stage_update' also updates.

Moreover those fields are implemented using editable stored computed fields
which are triggered everytime a value is given to those fields, even when
the same value is given.

After this commit:
'date_last_stage_update' and 'date_open' will only update when there are
real changes.

Also fix 'date_open' update when lead is converted into an opportunity.
'date_open' is the date when a user is assigned to a lead / opportunity. It
should not be set when converting a lead to an opportunity, as those two
flows are different. Only setting a responsible should update it.

Task-3515225

closes odoo/odoo#161918

Forward-port-of: odoo/odoo#144848
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-04-16 07:02:57 +00:00
…
2024-04-16 07:02:57 +00:00
2024-04-15 09:10:09 +00:00
…
…
…
…
…
…

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%