Bugfix: toggle activities in projects. Reactivation was not perfect
bzr revid: pinky-bd06c1162ddacf3321ecf0f2f339a2f2026a6e8d
This commit is contained in:
parent
a8a1cb70ae
commit
289d9e092f
|
@ -134,11 +134,14 @@ class project(osv.osv):
|
|||
def setActive(self, cr, uid, id, value, context={}):
|
||||
proj = self.browse(cr, uid, id, context)
|
||||
self.write(cr, uid, [id], {'active': value}, context)
|
||||
cr.execute('select id from project_task where project_id=%d', (proj.id,))
|
||||
tasks_id = [x[0] for x in cr.fetchall()]
|
||||
self.pool.get('project.task').write(cr, uid,
|
||||
[task.id for task in proj.tasks],
|
||||
tasks_id,
|
||||
{'active': value}, context)
|
||||
for child in proj.child_id:
|
||||
self.setActive(cr, uid, child.id, value, context)
|
||||
project_ids = [x[0] for x in cr.fetchall()]
|
||||
for child in project_ids:
|
||||
self.setActive(cr, uid, child, value, context)
|
||||
return True
|
||||
project()
|
||||
|
||||
|
|
Loading…
Reference in New Issue