From 5a20b4cf7bf3ccfae417c2ec7d2872603d10b039 Mon Sep 17 00:00:00 2001 From: Thibault Francois Date: Tue, 25 Jan 2011 11:15:05 +0100 Subject: [PATCH] [FIX] crm : stage well assign according to the sales team if there is one, or according all stage if no sales team bzr revid: tfr@openerp.com-20110125101505-08sisemudvj7xsi2 --- addons/crm/crm_view.xml | 6 ++++-- addons/crm/wizard/crm_lead_to_opportunity.py | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/addons/crm/crm_view.xml b/addons/crm/crm_view.xml index bd0b56facc0..ff9c339b568 100644 --- a/addons/crm/crm_view.xml +++ b/addons/crm/crm_view.xml @@ -124,11 +124,13 @@
- + - + + + diff --git a/addons/crm/wizard/crm_lead_to_opportunity.py b/addons/crm/wizard/crm_lead_to_opportunity.py index b8cdb9feb79..05d0d9e7dbd 100644 --- a/addons/crm/wizard/crm_lead_to_opportunity.py +++ b/addons/crm/wizard/crm_lead_to_opportunity.py @@ -70,8 +70,10 @@ class crm_lead2opportunity(osv.osv_memory): cr, uid, opportunity_view_tree, context=context).res_id lead = leads.browse(cr, uid, record_id, context=context) - stage_ids = self.pool.get('crm.case.stage').search(cr, uid, [('type','=','opportunity'),('sequence','>=',1)]) - + if(lead.section_id): + stage_ids = self.pool.get('crm.case.stage').search(cr, uid, [('type','=','opportunity'),('sequence','>=',1), ('section_ids','=', lead.section_id.id)]) + else: + stage_ids = self.pool.get('crm.case.stage').search(cr, uid, [('type','=','opportunity'),('sequence','>=',1)]) for this in self.browse(cr, uid, ids, context=context): vals ={ 'planned_revenue': this.planned_revenue,