From dcd3702782e483c3b11bef6e5513a00f419b94cb Mon Sep 17 00:00:00 2001 From: dka-odoo Date: Wed, 18 Mar 2015 09:27:20 +0100 Subject: [PATCH] [FIX] hr_recruitment : use _track_subtype method instead of _track dict. --- addons/hr_recruitment/hr_recruitment.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index bc3daa72c8a..a8871b95081 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -600,11 +600,14 @@ class hr_job(osv.osv): _name = "hr.job" _inherits = {'mail.alias': 'alias_id'} - _track = { - 'state': { - 'hr_recruitment.mt_job_new': lambda self, cr, uid, obj, ctx=None: obj.state == 'open' - }, - } + + + def _track_subtype(self, cr, uid, ids, init_values, context=None): + record = self.browse(cr, uid, ids[0], context=context) + if 'state' in init_values and record.state == 'open': + return 'hr_recruitment.mt_job_new' + return super(hr_job, self)._track_subtype(cr, uid, ids, init_values, context=context) + def _get_attached_docs(self, cr, uid, ids, field_name, arg, context=None): res = {}