From 72dd5cdbc3e59244b38e950552f2206bd9c09000 Mon Sep 17 00:00:00 2001 From: Hiral Bhavsar Date: Thu, 24 Oct 2019 06:12:09 +0000 Subject: [PATCH] [FIX] crm: opportunity restored tracking title Currently, the "Opportunity restored" note appears while changing the tracking field's value, which is incorrect. The "Opportunity restored" title should only appear when the modification is done by clicking on the "Restore" button. Thus, make a condition proper to display this title "Opportunity restored". task-2089784 closes odoo/odoo#39447 X-original-commit: 14453bf9dc6677056329b4599c798d6bf5273980 Signed-off-by: Thibault Delavallee (tde) --- addons/crm/models/crm_lead.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/models/crm_lead.py b/addons/crm/models/crm_lead.py index 467e586a19b..f573e8dada1 100644 --- a/addons/crm/models/crm_lead.py +++ b/addons/crm/models/crm_lead.py @@ -1176,7 +1176,7 @@ class Lead(models.Model): return self.env.ref('crm.mt_lead_lost') elif 'stage_id' in init_values: return self.env.ref('crm.mt_lead_stage') - elif self.active: + elif 'active' in init_values and self.active: return self.env.ref('crm.mt_lead_restored') return super(Lead, self)._track_subtype(init_values)