[IMP]: In the phonecall view, the button schedule a meeting must open the calendar...
authoruco (OpenERP) <uco@tinyerp.co.in>
Wed, 13 Jan 2010 04:55:35 +0000 (10:25 +0530)
committeruco (OpenERP) <uco@tinyerp.co.in>
Wed, 13 Jan 2010 04:55:35 +0000 (10:25 +0530)
bzr revid: uco@tinyerp.co.in-20100113045535-lsq2j740hgdd8jd4

addons/crm/wizard/crm_phonecall_wizard.py

index 3a06c1c..97fb97b 100644 (file)
@@ -189,43 +189,9 @@ class phonecall2opportunity(wizard.interface):
 phonecall2opportunity('crm.phonecall.opportunity_set')
 
 class phonecall2meeting(wizard.interface):
-    case_form = """<?xml version="1.0"?>
-    <form string="Plan Meeting">
-        <field name="date"/>
-        <field name="duration" widget="float_time"/>
-        <label string="Note that you can also use the calendar view to graphically schedule your next meeting." colspan="4"/>
-    </form>"""
-
-    case_fields = {
-        'date': {'string': 'Meeting date', 'type': 'datetime', 'required': 1},
-        'duration': {'string': 'Duration (Hours)', 'type': 'float', 'required': 1}
-    }
-
-    def _selectPartner(self, cr, uid, data, context):
-        case_obj = pooler.get_pool(cr.dbname).get('crm.phonecall')
-        case = case_obj.browse(cr, uid, data['id'])
-        return {'date': case.date, 'duration': case.duration or 2.0}
 
     def _makeMeeting(self, cr, uid, data, context):
         pool = pooler.get_pool(cr.dbname)
-        phonecall_case_obj = pool.get('crm.phonecall')
-        meeting_case_obj = pool.get('crm.meeting')        
-        for phonecall in phonecall_case_obj.browse(cr, uid, data['ids']):         
-            #TODO : Take other info from phonecall
-            new_meeting_id = meeting_case_obj.create(cr, uid, {
-                'name': phonecall.name,
-                'date': data['form']['date'],
-                'duration': data['form']['duration'],
-                'case_id': phonecall.id,
-                })
-            new_meeting = meeting_case_obj.browse(cr, uid, new_meeting_id)
-            vals = {}
-            if not phonecall.case_id:
-                vals.update({'case_id' : new_meeting.inherit_case_id.id})
-            phonecall_case_obj.write(cr, uid, [phonecall.id], vals)
-            phonecall_case_obj.case_cancel(cr, uid, [phonecall.id])
-            meeting_case_obj.case_open(cr, uid, [new_meeting_id])
-
         data_obj = pool.get('ir.model.data')
         result = data_obj._get_id(cr, uid, 'crm', 'view_crm_case_meetings_filter')
         id = data_obj.read(cr, uid, result, ['res_id'])
@@ -251,19 +217,16 @@ class phonecall2meeting(wizard.interface):
 
     states = {
         'init': {
-            'actions': [_selectPartner],
-            'result': {'type': 'form', 'arch': case_form, 'fields': case_fields,
-                'state' : [('end', 'Cancel','gtk-cancel'),('order', 'Set Meeting','gtk-go-forward')]}
+            'actions': [],
+            'result': {'type': 'action', 'action': _makeMeeting, 'state': 'order'}
         },
         'order': {
             'actions': [],
-            'result': {'type': 'action', 'action': _makeMeeting, 'state': 'end'}
+            'result': {'type': 'state', 'state': 'end'}
         }
     }
-
 phonecall2meeting('crm.phonecall.meeting_set')
 
-
 class partner_create(wizard.interface):
 
     case_form = """<?xml version="1.0"?>