[FIX]: Fix problem of recurrency edit all button in project caldav module.
bzr revid: atp@tinyerp.co.in-20101110073500-rk6v6c4momty5xz0
This commit is contained in:
@@ -22,7 +22,8 @@
|
||||
from osv import fields, osv
|
||||
from caldav import calendar
|
||||
from datetime import datetime
|
||||
|
||||
from tools.translate import _
|
||||
from base_calendar import base_calendar
|
||||
from project.project import task as base_project_task
|
||||
|
||||
class project_task(osv.osv):
|
||||
@@ -45,6 +46,50 @@ class project_task(osv.osv):
|
||||
'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')
|
||||
|
||||
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
|
||||
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)
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<button string="Edit All"
|
||||
help="Edit all Ourrences of recurrent Task"
|
||||
attrs="{'invisible':[('rrule_type','in', ('none', False))]}"
|
||||
name="open_meeting" icon="gtk-edit"
|
||||
name="open_task" icon="gtk-edit"
|
||||
type="object" />
|
||||
<button string="Exclude range" groups="base.group_extended"
|
||||
help="Add Exception Rule"
|
||||
|
||||
Reference in New Issue
Block a user