Skip to content

Commit

Permalink
CP-111 remove donors from onboarding when merged with sponsor (#1535)
Browse files Browse the repository at this point in the history
* cp-111 remove donors from onboarding when merged with sponsor

* Update partner_compassion/wizards/partner_merge_wizard.py

Co-authored-by: ecino <[email protected]>
(cherry picked from commit 3eec1c5)
  • Loading branch information
duvenhage authored and ecino committed Oct 5, 2022
1 parent 6723cf0 commit 88e33e7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions partner_compassion/wizards/partner_merge_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ def action_merge(self):
"to send new labels to them."
)
)
# check onboarding_new_donor_start_date for non-dst partner. If set,
# and dst partner is sponsor, clear the onboarding_new_donor_start_date.
if removing.onboarding_new_donor_start_date:
sponsor_category = self.env.ref("partner_compassion.res_partner_category_sponsor")
if sponsor_category in self.dst_partner_id.category_id:
removing.onboarding_new_donor_start_date = False

old_emails = removing.filtered("email").mapped("email")
new_email = self.dst_partner_id.email
for email in old_emails:
Expand Down

0 comments on commit 88e33e7

Please sign in to comment.