From 88e33e760903230d4cebb081e2b77ac38d9a7487 Mon Sep 17 00:00:00 2001 From: duvenhage Date: Wed, 5 Oct 2022 13:50:01 +0200 Subject: [PATCH] CP-111 remove donors from onboarding when merged with sponsor (#1535) * cp-111 remove donors from onboarding when merged with sponsor * Update partner_compassion/wizards/partner_merge_wizard.py Co-authored-by: ecino (cherry picked from commit 3eec1c5e81e13652c2d6cc06912abd8e865108b3) --- partner_compassion/wizards/partner_merge_wizard.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/partner_compassion/wizards/partner_merge_wizard.py b/partner_compassion/wizards/partner_merge_wizard.py index d53b61e86..5d5bf5252 100644 --- a/partner_compassion/wizards/partner_merge_wizard.py +++ b/partner_compassion/wizards/partner_merge_wizard.py @@ -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: