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()