From b46b0936a8c8234dc896c815b1f6decf8f92f7b1 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 31 May 2016 19:01:59 +0200 Subject: [PATCH] [FIX] crm: `date_closed` when writting without `probability` value If `probability` is not being written, `vals.get('probability')` is `None` `None` < 100 is `True` While it should not remove the `date_closed` value when the probability field is not being rewritten on the lead, but something else is. opw-677273 --- addons/crm/crm_lead.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index f33d4c16ad5..0afac95535d 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -906,7 +906,7 @@ class crm_lead(format_address, osv.osv): vals.update(onchange_stage_values) if vals.get('probability') >= 100 or not vals.get('active', True): vals['date_closed'] = fields.datetime.now() - elif vals.get('probability') < 100: + elif 'probability' in vals and vals['probability'] < 100: vals['date_closed'] = False return super(crm_lead, self).write(cr, uid, ids, vals, context=context)