From 40b1ab36bbdaf4af11c0a8eb5beca0c8c068ebe2 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Tue, 4 Mar 2014 16:44:42 +0100 Subject: [PATCH] [FIX] crm: convert lead to opp wizard, on change salesman choose default salesteam if any bzr revid: dle@openerp.com-20140304154442-o2zvun8ehv2ro6dl --- addons/crm/wizard/crm_lead_to_opportunity.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/addons/crm/wizard/crm_lead_to_opportunity.py b/addons/crm/wizard/crm_lead_to_opportunity.py index 0c51ab64a03..09e917479dc 100644 --- a/addons/crm/wizard/crm_lead_to_opportunity.py +++ b/addons/crm/wizard/crm_lead_to_opportunity.py @@ -100,10 +100,8 @@ class crm_lead2opportunity_partner(osv.osv_memory): else: user_in_section = False if not user_in_section: - section_id = False - section_ids = self.pool.get('crm.case.section').search(cr, uid, ['|', ('user_id', '=', user_id), ('member_ids', '=', user_id)], context=context) - if section_ids: - section_id = section_ids[0] + result = self.pool['crm.lead'].on_change_user(cr, uid, ids, user_id, context=context) + section_id = result.get('value') and result['value'].get('section_id') and result['value']['section_id'] or False return {'value': {'section_id': section_id}} def view_init(self, cr, uid, fields, context=None):