diff --git a/addons/crm/wizard/crm_opportunity_wizard.py b/addons/crm/wizard/crm_opportunity_wizard.py index 15ecb55001b..d7ec0b72cb6 100644 --- a/addons/crm/wizard/crm_opportunity_wizard.py +++ b/addons/crm/wizard/crm_opportunity_wizard.py @@ -150,9 +150,15 @@ class opportunity2meeting(wizard.interface): id2 = data_obj.browse(cr, uid, id2, context=context).res_id if id3: id3 = data_obj.browse(cr, uid, id3, context=context).res_id + opportunity = opportunity_case_obj.browse(cr, uid, data['id'], context=context) + partner_id = opportunity.partner_id and opportunity.partner_id.id or False + name = opportunity.name + email = opportunity.email_from + section_id = opportunity.section_id and opportunity.section_id.id or False return { 'name': _('Meetings'), - 'domain' : "[('opportunity_id','in',%s)]"%(data['ids']), + 'domain' : "[('user_id','=',%s)]"%(uid), + 'context': {'default_partner_id': partner_id, 'default_section_id': section_id, 'default_email_from': email, 'default_state':'open', 'default_name':name}, 'view_type': 'form', 'view_mode': 'calendar,form,tree', 'res_model': 'crm.meeting', diff --git a/addons/crm/wizard/crm_phonecall_wizard.py b/addons/crm/wizard/crm_phonecall_wizard.py index 73a3604fd95..6ac2f30b994 100644 --- a/addons/crm/wizard/crm_phonecall_wizard.py +++ b/addons/crm/wizard/crm_phonecall_wizard.py @@ -281,9 +281,15 @@ class phonecall2meeting(wizard.interface): id2 = data_obj.browse(cr, uid, id2, context=context).res_id if id3: id3 = data_obj.browse(cr, uid, id3, context=context).res_id + phonecall = phonecall_case_obj.browse(cr, uid, data['id'], context=context) + partner_id = phonecall.partner_id and phonecall.partner_id.id or False + name = phonecall.name + email = phonecall.email_from + section_id = phonecall.section_id and phonecall.section_id.id or False return { 'name': _('Meetings'), - 'domain' : "[('phonecall_id','in',%s)]"%(data['ids']), + 'domain' : "[('user_id','=',%s)]"%(uid), + 'context': {'default_partner_id': partner_id, 'default_section_id': section_id, 'default_email_from': email, 'default_state':'open', 'default_name':name}, 'view_type': 'form', 'view_mode': 'calendar,form,tree', 'res_model': 'crm.meeting',