[IMP] add manager plan to manager group
bzr revid: mat@openerp.com-20130313101258-1zuqwkapeef1pvty
This commit is contained in:
@@ -289,7 +289,7 @@ class gamification_goal(osv.Model):
|
||||
"""Overwrite the write method to update the last_update field to today
|
||||
|
||||
If the current value is changed and the report frequency is set to On
|
||||
change, q report is generated"""
|
||||
change, a report is generated"""
|
||||
|
||||
vals['last_update'] = fields.date.today()
|
||||
for goal in self.browse(cr, uid, ids, context=context):
|
||||
|
||||
@@ -193,6 +193,12 @@ class gamification_goal_plan(osv.Model):
|
||||
new_group = self.pool.get('res.groups').browse(cr, uid, vals['autojoin_group_id'], context=context)
|
||||
if new_group:
|
||||
self.plan_subscribe_users(cr, uid, ids, [user.id for user in new_group.users], context=context)
|
||||
|
||||
# add the selected manager to the goal_manager group
|
||||
if 'manager_id' in vals:
|
||||
group_ref = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'gamification', 'group_goal_manager')
|
||||
self.pool.get('res.users').write(cr, uid, [vals['manager_id']], {'groups_id': [(4, group_ref[1])]}, context=context)
|
||||
|
||||
return write_res
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user