diff --git a/addons/project/project.py b/addons/project/project.py index 76e62df6a80..996e79a1f8b 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -441,6 +441,7 @@ class task(osv.osv): 'work_ids': fields.one2many('project.task.work', 'task_id', 'Work done'), 'manager_id': fields.related('project_id', 'analytic_account_id', 'user_id', type='many2one', relation='res.users', string='Project Manager'), 'company_id': fields.many2one('res.company', 'Company'), + 'id': fields.integer('ID'), } _defaults = { diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index 69833383efe..6efc64dd494 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -303,6 +303,7 @@ + diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index 82d5a1d70a1..2788b59ed7d 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -185,7 +185,7 @@ class project_issue(crm.crm_case, osv.osv): 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', help='This is the current user to whom the related task have been assigned'), + 'assigned_to': fields.related('task_id', 'user_id', string = 'Assigned to', type="many2one", relation="res.users", store=True, help='This is the current user to whom the related task have been assigned'), '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', \ @@ -318,6 +318,7 @@ class project_issue(crm.crm_case, osv.osv): 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) + self._history(cr, uid, cases, _('Escalate')) return True def message_new(self, cr, uid, msg, context): @@ -369,6 +370,31 @@ class project_issue(crm.crm_case, osv.osv): return res + def get_stage_dict(self, cr, uid, ids, context=None): + """This function gives dictionary for stage according to stage levels + @param self: The object pointer + @param cr: the current row, from the database cursor, + @param uid: the current user’s ID for security checks, + @param ids: List of case IDs + @param context: A standard dictionary for contextual values""" + if not context: + context = {} + stage_obj = self.pool.get('crm.case.stage') + domain = [('object_id.model', '=', self._name)] + if 'force_domain' in context and context['force_domain']: + domain += context['force_domain'] + sid = stage_obj.search(cr, uid, domain, context=context) + s = {} + previous = {} + section = self._name + + for stage in stage_obj.browse(cr, uid, sid, context=context): + s.setdefault(section, {}) + s[section][previous.get(section, False)] = stage.id + previous[section] = stage.id + return s + + def message_update(self, cr, uid, ids, vals={}, msg="", default_act='pending', context=None): if context is None: context = {} diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml index 9062b47a25e..b3b981d9847 100644 --- a/addons/project_issue/project_issue_view.xml +++ b/addons/project_issue/project_issue_view.xml @@ -73,7 +73,6 @@