From 65517d0f7b0dfd5a8075f0ccd9a7106766479078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 25 May 2012 13:51:02 +0200 Subject: [PATCH] [CLEAN] Moved a method in file. bzr revid: tde@openerp.com-20120525115102-wuqcdvgfzb51vm53 --- addons/crm/crm_lead.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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: