diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2023-04-03 11:24:47 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2023-04-03 11:24:47 +0700 |
| commit | 260ba347c21b906972c14d834aa8d97c4e9f26f6 (patch) | |
| tree | 78e83a11fa98e5d483835446086502481c0ea86f | |
| parent | 92ca4ca8d5e16a90c1cfa8d00248c1e12c95d9fd (diff) | |
bug fix sales person in leads
| -rwxr-xr-x | indoteknik_custom/models/crm_lead.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/indoteknik_custom/models/crm_lead.py b/indoteknik_custom/models/crm_lead.py index be4bbf5d..74b4796a 100755 --- a/indoteknik_custom/models/crm_lead.py +++ b/indoteknik_custom/models/crm_lead.py @@ -54,3 +54,12 @@ class CrmLead(models.Model): if tag.name.lower() in lead.body_html_lead.lower(): input_tags.append(tag.id) lead.tag_ids = input_tags + + if not lead.partner_id: + continue + + if lead.partner_id.parent_id: + salesperson_id = lead.partner_id.parent_id.user_id + else: + salesperson_id = lead.partner_id.user_id + lead.user_id = salesperson_id |
