From 5ab447841e4a6e7bb168484e6aea1ac0121e67da Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Tue, 19 Jan 2010 15:44:04 +0530 Subject: [PATCH] [IMP]CRM: set the phonecall_id and partner_id bzr revid: sbh@tinyerp.com-20100119101404-1aoj4wt6onyjkj6f --- addons/crm/wizard/crm_opportunity_wizard.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/addons/crm/wizard/crm_opportunity_wizard.py b/addons/crm/wizard/crm_opportunity_wizard.py index 9641c6ac055..b33da1cd258 100644 --- a/addons/crm/wizard/crm_opportunity_wizard.py +++ b/addons/crm/wizard/crm_opportunity_wizard.py @@ -91,9 +91,15 @@ class opportunity2phonecall(wizard.interface): 'categ_id' : form['category_id'], 'description' : form['note'], 'date' : form['deadline'], - 'section_id' : form['section_id'] + 'section_id' : form['section_id'], + 'partner_id': opportunity.partner_id.id, + 'partner_address_id':opportunity.partner_address_id.id, + 'description':opportunity.description }, context=context) - + vals = {} + if not opportunity.phonecall_id: + vals.update({'phonecall_id' : new_case}) + opportunity_case_obj.write(cr, uid, [opportunity.id], vals) opportunity_case_obj.case_cancel(cr, uid, [opportunity.id]) phonecall_case_obj.case_open(cr, uid, [new_case])