[MERGE]:merged rma's branch

bzr revid: apa@tinyerp.com-20121105104145-9m9bhnuuuy68a55w
This commit is contained in:
Amit Patel
2012-11-05 16:11:45 +05:30
2 changed files with 19 additions and 2 deletions
+18 -1
View File
@@ -1305,7 +1305,24 @@ class task(base_stage, osv.osv):
msg = _('Task has been <b>delegated</b> to <em>%s</em>.') % (task.user_id.name)
self.message_post(cr, uid, [task.id], body=msg, context=context)
return True
def project_task_reevaluate(self, cr, uid, ids, context=None):
data = {}
cr.execute('SELECT max(id) FROM project_config_settings' )
res = cr.fetchone()
setting_id = res and res[0] or None
if setting_id and setting_id != None:
config_id = self.pool.get('project.config.settings').browse(cr, uid, setting_id, context=context)
if config_id.group_time_work_estimation_tasks:
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'project.task.reevaluate',
'type': 'ir.actions.act_window',
'target': 'new',
'context' : context
}
return self.do_reopen(cr, uid, ids, context=context)
class project_work(osv.osv):
_name = "project.task.work"
+1 -1
View File
@@ -392,7 +392,7 @@
<button name="do_draft" string="Draft" type="object"
states="cancel,done"/>
-->
<button name="%(action_project_task_reevaluate)d" string="Reactivate" type="action"
<button name="project_task_reevaluate" string="Reactivate" type="object"
states="cancelled,done" context="{'button_reactivate':True}" groups="base.group_user"/>
<button name="action_close" string="Done" type="object"
states="draft,open,pending" groups="base.group_user"/>