[IMP] crm: put misssing value on scheduling meeting
authorHarry (Open ERP) <hmo@tinyerp.com>
Thu, 4 Mar 2010 11:25:45 +0000 (16:55 +0530)
committerHarry (Open ERP) <hmo@tinyerp.com>
Thu, 4 Mar 2010 11:25:45 +0000 (16:55 +0530)
bzr revid: hmo@tinyerp.com-20100304112545-aoadijm4vxs1c87w

addons/crm/wizard/crm_opportunity_wizard.py
addons/crm/wizard/crm_phonecall_wizard.py

index 15ecb55..d7ec0b7 100644 (file)
@@ -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',
index 73a3604..6ac2f30 100644 (file)
@@ -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',