'state': 'draft',
}
+
+ def open_task(self, cr, uid, ids, context=None):
+ """
+ Open Task Form for Project Task.
+ @param cr: the current row, from the database cursor,
+ @param uid: the current user’s ID for security checks,
+ @param ids: List of project task’s IDs
+ @param context: A standard dictionary for contextual values
+ @return: Dictionary value which open Project Task form.
+ """
+
+ if not context:
+ context = {}
+
- data_obj = self.pool.get('ir.model.data')
-
++ data_pool = self.pool.get('ir.model.data')
+ value = {}
-
- task_form_ids = data_obj._get_id(cr, uid, 'project', 'view_task_form2')
- task_tree_ids = data_obj._get_id(cr, uid, 'project', 'view_task_tree2')
- task_calendar_ids = data_obj._get_id(cr, uid, 'project', 'view_task_calendar')
-
- if task_form_ids:
- task_form_id = data_obj.browse(cr, uid, task_form_ids, context=context).res_id
- if task_tree_ids:
- task_tree_id = data_obj.browse(cr, uid, task_tree_ids, context=context).res_id
- if task_calendar_ids:
- task_calendar_id = data_obj.browse(cr, uid, task_calendar_ids, context=context).res_id
++ task_form_id = data_pool.get_object(cr, uid, 'project', 'view_task_form2')
++ task_tree_id = data_pool.get_object(cr, uid, 'project', 'view_task_tree2')
++ task_calendar_id = data_pool.get_object(cr, uid, 'project', 'view_task_calendar')
+ for id in ids:
+ value = {
+ 'name': _('Tasks'),
+ 'view_type': 'form',
+ 'view_mode': 'form,tree',
+ 'res_model': 'project.task',
+ 'view_id': False,
+ 'views': [(task_form_id, 'form'), (task_tree_id, 'tree'), (task_calendar_id, 'calendar')],
+ 'type': 'ir.actions.act_window',
+ 'res_id': base_calendar.base_calendar_id2real_id(id),
+ 'nodestroy': True
+ }
+
+ return value
+
+
def import_cal(self, cr, uid, data, data_id=None, context=None):
todo_obj = self.pool.get('basic.calendar.todo')
vals = todo_obj.import_cal(cr, uid, data, context=context)