From a8378f9d625f6d3a7d4e5f2f5c5e1c6a876ffc51 Mon Sep 17 00:00:00 2001 From: "qdp-launchpad@tinyerp.com" <> Date: Wed, 14 Jul 2010 02:39:48 +0530 Subject: [PATCH] [IMP] project_issue: escalation will now escalate also the task and empty the responsible of it bzr revid: qdp-launchpad@tinyerp.com-20100713210948-gx2jziuq313edtoe --- addons/project_issue/project_issue.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index d0b280db048..473d67750e0 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -183,7 +183,7 @@ class project_issue(osv.osv, crm.crm_case): method=True, multi='day_open', type="float", store=True), 'day_close': fields.function(_compute_day, string='Days to Close', \ method=True, multi='day_close', type="float", store=True), - 'assigned_to': fields.many2one('res.users', 'Assigned to'), + 'assigned_to': fields.related('task_id', 'user_id', type='many2one', relation='res.users', string='Assigned to', help='This is the current user to whom the related task have been assigned', readonly=True), 'working_hours_open': fields.function(_compute_day, string='Working Hours to Open the Issue', \ method=True, multi='working_days_open', type="float", store=True), 'working_hours_close': fields.function(_compute_day, string='Working Hours to Close the Issue', \ @@ -297,12 +297,12 @@ class project_issue(osv.osv, crm.crm_case): cases = self.browse(cr, uid, ids) for case in cases: data = {} - if case.task_id: - raise osv.except_osv(_('Warning !'), _('You cannot escalate this issue.\nThere is a task attached to it!')) if case.project_id.project_escalation_id: data['project_id'] = case.project_id.project_escalation_id.id if case.project_id.project_escalation_id.user_id: data['user_id'] = case.project_id.project_escalation_id.user_id.id + if case.task_id: + self.pool.get('project.task').write(cr, uid, [case.task_id.id], {'project_id': data['project_id'], 'user_id': False}) else: raise osv.except_osv(_('Warning !'), _('You cannot escalate this issue.\nThe relevant Project has not configured the Escalation Project!')) self.write(cr, uid, [case.id], data)