From: Thibault Delavallée Date: Mon, 4 Nov 2013 11:57:35 +0000 (+0100) Subject: [FIX] crm_lead: cleaned and uniformized won/lost X-Git-Tag: InsPy_master01~666^2~142^2~10^2 X-Git-Url: http://git.inspyration.org/?a=commitdiff_plain;h=61c97c56de593a017959bd8c8970ef5a58643b2f;p=odoo%2Fodoo.git [FIX] crm_lead: cleaned and uniformized won/lost stage conditions. bzr revid: tde@openerp.com-20131104115735-4bsv2l2n1c6q8jte --- diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index cbe1005..5f52980 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -74,8 +74,8 @@ class crm_lead(format_address, osv.osv): # this is only an heuristics; depending on your particular stage configuration it may not match all 'new' stages 'crm.mt_lead_create': lambda self, cr, uid, obj, ctx=None: obj.probability == 0 and obj.stage_id and obj.stage_id.sequence <= 1, 'crm.mt_lead_stage': lambda self, cr, uid, obj, ctx=None: (obj.stage_id and obj.stage_id.sequence > 1) and obj.probability < 100, - 'crm.mt_lead_won': lambda self, cr, uid, obj, ctx=None: obj.probability == 100 and obj.stage_id and obj.stage_id.on_change, - 'crm.mt_lead_lost': lambda self, cr, uid, obj, ctx=None: obj.probability == 0 and obj.stage_id and obj.stage_id.sequence > 1, + 'crm.mt_lead_won': lambda self, cr, uid, obj, ctx=None: obj.probability == 100 and obj.stage_id and obj.stage_id.fold, + 'crm.mt_lead_lost': lambda self, cr, uid, obj, ctx=None: obj.probability == 0 and obj.stage_id and obj.stage_id.fold and obj.stage_id.sequence > 1, }, } @@ -406,7 +406,7 @@ class crm_lead(format_address, osv.osv): :deprecated: this method will be removed in OpenERP v8. """ for lead in self.browse(cr, uid, ids): - stage_id = self.stage_find(cr, uid, [lead], lead.section_id.id or False, [('probability', '=', 100.0), ('fold', '=', True), ('sequence', '>', 1)], context=context) + stage_id = self.stage_find(cr, uid, [lead], lead.section_id.id or False, [('probability', '=', 100.0), ('fold', '=', True)], context=context) if stage_id: return self.write(cr, uid, [lead.id], {'stage_id': stage_id}, context=context) else: