[Fix] crm: fix problem of duplicate lead

bzr revid: sbh@tinyerp.com-20101217093347-6o4fv1uvnxydlom1
This commit is contained in:
Sbh (OpenERP) 2010-12-17 15:03:47 +05:30
parent 1cf0cba464
commit 69cadabda6
1 changed files with 1 additions and 2 deletions

View File

@ -304,11 +304,10 @@ class crm_lead(crm_case, osv.osv):
self.history(cr, uid, ids, _('Stage'), details=stage_obj.name)
message=''
for case in self.browse(cr, uid, ids, context=context):
if case.type == 'lead':
if case.type == 'lead' or context.get('stage_type',False)=='lead':
message = _("The stage of lead '%s' has been changed to '%s'.") % (case.name, case.stage_id.name)
elif case.type == 'opportunity':
message = _("The stage of opportunity '%s' has been changed to '%s'.") % (case.name, case.stage_id.name)
self.log(cr, uid, case.id, message)
return super(crm_lead,self).write(cr, uid, ids, vals, context)
def stage_next(self, cr, uid, ids, context=None):