[MERGE] merged the branch from cbi that fixes the default stage on leads/opportunities
bzr revid: qdp-launchpad@openerp.com-20121228140733-ywx93g9y66zrs2ci
This commit is contained in:
@@ -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_id', 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)
|
||||
|
||||
Reference in New Issue
Block a user