[IMP] hr_timesheet : Override the 'on_change_template' method.

bzr revid: mdi@tinyerp.com-20120723121029-9manyfm4brhsbuf0
This commit is contained in:
Divyesh Makwana (Open ERP)
2012-07-23 17:40:29 +05:30
parent c1c88c7494
commit cbcf68d3d9
+7
View File
@@ -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()