You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Context
-------
Leads get assigned a different company than the one defined on the salesman
after being merged with another lead.
This happens because some leads assigned to a user_id have no company set. They
are merged with leads that receive self.env.company during assigment to the
to the team and then get merged with the lead without company. So the company
of the new lead is written on the old one.
Behavior before this PR
-----------------------
When the crm.team have the field company_id = False
With the following flow
1) Create a lead without a user_id and a team_id
2) Assign a team to the lead
3) Assign a user_id
The status of the company field on the lead is the following
1) set the company of the env.user
2) Keep the company of the lead
3) set the user company if the current company is not one of the allowed
company of the user
Behavior after this PR
----------------------
1) set the company of the env.user
2) set the company of the team even if it's False
(so erase the company if the team has no company set)
3) set the user company if the current company is not one of the allowed
company of the user
Other changes
-------------
When resetting team and user: void company to avoid having leads without
any information but a company set. It eases assignment.
Task-2520276
closesodoo#72088
Signed-off-by: Thibault Delavallee (tde) <[email protected]>
Co-authored-by: Thibault Delavallée <[email protected]>
Co-authored-by: Thibault François <[email protected]>
0 commit comments