From cbcf68d3d98d25e8128b9869f225396667eb8b50 Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Mon, 23 Jul 2012 17:40:29 +0530 Subject: [PATCH] [IMP] hr_timesheet : Override the 'on_change_template' method. bzr revid: mdi@tinyerp.com-20120723121029-9manyfm4brhsbuf0 --- addons/hr_timesheet/hr_timesheet.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/addons/hr_timesheet/hr_timesheet.py b/addons/hr_timesheet/hr_timesheet.py index 66911f25ff5..53119853c31 100644 --- a/addons/hr_timesheet/hr_timesheet.py +++ b/addons/hr_timesheet/hr_timesheet.py @@ -198,6 +198,13 @@ class account_analytic_account(osv.osv): _columns = { 'use_timesheets': fields.boolean('Timesheets', help="Check this field if this project manages timesheets"), } + + def on_change_template(self, cr, uid, ids, template_id, context=None): + res = super(account_analytic_account, self).on_change_template(cr, uid, ids, template_id, context=context) + if template_id and 'value' in res: + template = self.browse(cr, uid, template_id, context=context) + res['value']['use_timesheets'] = template.use_timesheets + return res account_analytic_account()