diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 00d06c17d4d..33e40de53b6 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -46,6 +46,11 @@ class crm_lead(crm_case, osv.osv): """ Gives default section by checking if present in the context """ return self._resolve_section_id_from_context(cr, uid, context=context) + def _get_default_stage_id(self, cr, uid, context=None): + """ Gives default stage_id """ + section_id = self._get_default_section_id(cr, uid, context=context) + return self.stage_find(cr, uid, [], section_id, [('state', '=', 'draft'), ('type', '=', 'both')], context=context) + def _resolve_section_id_from_context(self, cr, uid, context=None): """ Returns ID of section based on the value of 'section_id' context key, or None if it cannot be resolved to a single @@ -268,11 +273,6 @@ class crm_lead(crm_case, osv.osv): return {'value':{}} return {'value':{'probability': stage.probability}} - def _get_default_stage_id(self, cr, uid, context=None): - """ Gives default stage_id """ - section_id = self._get_default_section_id(cr, uid, context=context) - return self.stage_find(cr, uid, [], section_id, [('state', '=', 'draft'), ('type', '=', 'both')], context=context) - def stage_find(self, cr, uid, cases, section_id, domain=[], order='sequence', context=None): """ Override of the base.stage method Parameter of the stage search taken from the lead: