[FIX] calendar: send invitation with correct ics file and fixed problem in project caldev
bzr revid: hmo@tinyerp.com-20100713072149-ltjnywgg4g142x61
This commit is contained in:
parent
f59127d271
commit
d7f41730a8
|
@ -409,6 +409,7 @@ property or property parameter."),
|
|||
return res
|
||||
cal = vobject.iCalendar()
|
||||
event = cal.add('vevent')
|
||||
event.add('uid').value = 'OpenObject-%s_%s@%s' % (event_obj._name, event_obj.id, cr.dbname)
|
||||
event.add('created').value = ics_datetime(time.strftime('%Y-%m-%d %H:%M:%S'))
|
||||
event.add('dtstart').value = ics_datetime(event_obj.date)
|
||||
event.add('dtend').value = ics_datetime(event_obj.date_deadline)
|
||||
|
@ -546,13 +547,13 @@ property or property parameter."),
|
|||
context = {}
|
||||
|
||||
for vals in self.browse(cr, uid, ids, context=context):
|
||||
#user = vals.user_id
|
||||
#if user:
|
||||
# mod_obj = self.pool.get(vals.ref._name)
|
||||
# if vals.ref:
|
||||
# if vals.ref.user_id.id != user.id:
|
||||
# defaults = {'user_id': user.id}
|
||||
# new_event = mod_obj.copy(cr, uid, vals.ref.id, default=defaults, context=context)
|
||||
user = vals.user_id
|
||||
if user:
|
||||
mod_obj = self.pool.get(vals.ref._name)
|
||||
if vals.ref:
|
||||
if vals.ref.user_id.id != user.id:
|
||||
defaults = {'user_id': user.id}
|
||||
new_event = mod_obj.copy(cr, uid, vals.ref.id, default=defaults, context=context)
|
||||
self.write(cr, uid, vals.id, {'state': 'accepted'}, context)
|
||||
|
||||
return True
|
||||
|
|
|
@ -30,7 +30,13 @@ class project_task(osv.osv):
|
|||
'create_date': fields.datetime('Create Date'),
|
||||
'attendee_ids': fields.many2many('calendar.attendee', \
|
||||
'task_attendee_rel', 'task_id', 'attendee_id', 'Attendees'),
|
||||
}
|
||||
'state': fields.selection([('draft', 'Draft'),('open', 'In Progress'),('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')], 'State', readonly=True, required=True,
|
||||
help='If the task is created the state is \'Draft\'.\n If the task is started, the state becomes \'In Progress\'.\n If review is needed the task is in \'Pending\' state.\
|
||||
\n If the task is over, the states is set to \'Done\'.'),
|
||||
}
|
||||
_defaults = {
|
||||
'state': 'draft',
|
||||
}
|
||||
|
||||
def import_cal(self, cr, uid, data, data_id=None, context=None):
|
||||
todo_obj = self.pool.get('basic.calendar.todo')
|
||||
|
@ -43,7 +49,7 @@ class project_task(osv.osv):
|
|||
ids = []
|
||||
for val in vals:
|
||||
obj_tm = self.pool.get('res.users').browse(cr, uid, uid, context).company_id.project_time_mode_id
|
||||
if not val.has_key('planned_hours'):
|
||||
if not val.get('planned_hours', False):
|
||||
# 'Computes duration' in days
|
||||
plan = 0.0
|
||||
if val.get('date') and val.get('date_deadline'):
|
||||
|
|
Loading…
Reference in New Issue