[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
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user