[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) <tde@openerp.com>
This commit is contained in:
Hiral Bhavsar
2019-10-28 13:26:59 +00:00
committed by fw-bot
parent fa991061ee
commit 72dd5cdbc3
+1 -1
View File
@@ -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)