[FIX] Leads no longer get a random draft stage, but correctly get one from their sales team
bzr revid: cbi@openerp.com-20121228121858-bcbsinqx7ong724c
This commit is contained in:
parent
9d514ab089
commit
39888a5128
|
@ -84,6 +84,13 @@ class crm_lead(base_stage, format_address, osv.osv):
|
|||
},
|
||||
}
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
if not context.get('default_section', False) and vals.get('section_id', False):
|
||||
ctx = context.copy()
|
||||
ctx['default_section_id'] = vals['section_id']
|
||||
vals['stage_id'] = self._get_default_stage_id(cr, uid, context=ctx)
|
||||
return super(crm_lead, self).create(cr, uid, vals, context=context)
|
||||
|
||||
def _get_default_section_id(self, cr, uid, context=None):
|
||||
""" Gives default section by checking if present in the context """
|
||||
return (self._resolve_section_id_from_context(cr, uid, context=context) or False)
|
||||
|
|
Loading…
Reference in New Issue