[IMP] project: variable scoping, no need to get the project.task pool if there's no task id to use it with

bzr revid: xmo@openerp.com-20111014115217-ym5o4tz3cmbb3c1l
This commit is contained in:
Xavier Morel
2011-10-14 13:52:17 +02:00
parent e7a367b80a
commit 98c5dc6f6a
@@ -73,9 +73,9 @@ class project_task_reevaluate(osv.osv_memory):
if context is None:
context = {}
data = self.browse(cr, uid, ids, context=context)[0]
task_pool = self.pool.get('project.task')
task_id = context.get('active_id')
if task_id:
task_pool = self.pool.get('project.task')
task_pool.write(cr, uid, task_id, {'remaining_hours': data.remaining_hours})
if context.get('button_reactivate'):
task_pool.do_reopen(cr, uid, [task_id], context=context)