-
Notifications
You must be signed in to change notification settings - Fork 30.4k
[FIX] crm: Fix lead multicompany issue #72088
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
tfr-odoo
wants to merge
2
commits into
odoo:saas-14.4
from
odoo-dev:saas-14.3-fix-company-from-team-tfr
Closed
[FIX] crm: Fix lead multicompany issue #72088
tfr-odoo
wants to merge
2
commits into
odoo:saas-14.4
from
odoo-dev:saas-14.3-fix-company-from-team-tfr
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
7256b05 to
e5a4119
Compare
Contributor
|
This PR targets the disabled branch odoo/odoo:saas-14.3, it can not be merged. |
e5a4119 to
36a51ad
Compare
36a51ad to
cd65d8a
Compare
dc81d45 to
037836f
Compare
Purpose of this commit is to highlight current behavior of multi company in lead. Notably a company is set at creation even when no team or user is set, leading to a lot of issues when dealing with lead merge or convert. Task-2520276 Co-Authored-By: Thibault Delavallée <[email protected]> Co-Authored-By: Thibault François <[email protected]>
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
Co-Authored-By: Thibault Delavallée <[email protected]>
Co-Authored-By: Thibault François <[email protected]>
037836f to
37c693e
Compare
Contributor
|
@robodoo r+ rebase-ff |
Contributor
|
Merge method set to rebase and fast-forward |
robodoo
pushed a commit
that referenced
this pull request
Oct 22, 2021
Purpose of this commit is to highlight current behavior of multi company in lead. Notably a company is set at creation even when no team or user is set, leading to a lot of issues when dealing with lead merge or convert. Task-2520276 Part-of: #72088 Co-authored-by: Thibault Delavallée <[email protected]> Co-authored-by: Thibault François <[email protected]>
robodoo
pushed a commit
that referenced
this pull request
Oct 22, 2021
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
closes #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]>
Contributor
|
This pull request has forward-port PRs awaiting action (not merged or closed): #78860 |
1 similar comment
Contributor
|
This pull request has forward-port PRs awaiting action (not merged or closed): #78860 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Context
Lead get assigned a different company than the one defined on the
salesman after being merge with another lead.
This happen because some lead assigned to a user_id have no company set
are merge with lead that receive self.env.company during automated
assignation to the team and than 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
The status of the company field on the lead is the following
Behavior after this PR
(so erase the company if the team has no company set)
Description of the issue/feature this PR addresses:
Current behavior before PR:
Desired behavior after PR is merged:
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr