diff options
| author | qdp-launchpad@tinyerp.com <> | 2010-07-14 02:39:48 +0530 |
|---|---|---|
| committer | qdp-launchpad@tinyerp.com <> | 2010-07-14 02:39:48 +0530 |
| commit | a8378f9d625f6d3a7d4e5f2f5c5e1c6a876ffc51 (patch) | |
| tree | c09f8b3790c6ccbb13ca82f888aceeffc0b62a1a /addons | |
| parent | f7f4db9ce1c4436bfa0989117610ee5fcd0601ea (diff) | |
[IMP] project_issue: escalation will now escalate also the task and empty the responsible of it
bzr revid: qdp-launchpad@tinyerp.com-20100713210948-gx2jziuq313edtoe
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/project_issue/project_issue.py | 6 |
1 files 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) |
