Skip to content

Commit

Permalink
fix: hide converted or lead set activity which happen behind the scene
Browse files Browse the repository at this point in the history
  • Loading branch information
shariquerik committed Nov 7, 2023
1 parent b6060fa commit e969414
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions crm/api/activities.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,18 @@ def get_deal_activities(name):

if change := data.get("changed")[0]:
field_label, field_option = next(((f.label, f.options) for f in deal_fields_meta if f.fieldname == change[0]), None)

if field_label == "Lead" or (not change[1] and not change[2]):
continue

activity_type = "changed"
data = {
"field": change[0],
"field_label": field_label,
"old_value": change[1],
"value": change[2],
}
if not change[1] and not change[2]:
continue

if not change[1] and change[2]:
activity_type = "added"
data = {
Expand Down Expand Up @@ -129,15 +132,18 @@ def get_lead_activities(name):

if change := data.get("changed")[0]:
field_label, field_option = next(((f.label, f.options) for f in lead_fields_meta if f.fieldname == change[0]), None)

if field_label == "Converted" or (not change[1] and not change[2]):
continue

activity_type = "changed"
data = {
"field": change[0],
"field_label": field_label,
"old_value": change[1],
"value": change[2],
}
if not change[1] and not change[2]:
continue

if not change[1] and change[2]:
activity_type = "added"
data = {
Expand Down

0 comments on commit e969414

Please sign in to comment.