From 9a3ce1a5ccaea171b2919084711756ddd753e821 Mon Sep 17 00:00:00 2001 From: "Chirag Dodiya (OpenERP)" Date: Tue, 7 Jan 2014 11:41:57 +0530 Subject: [PATCH] [IMP]Improved code to open contract wizard from hr timesheet bzr revid: cod@tinyerp.com-20140107061157-lt1b0qvvms8a0qdi --- addons/hr_timesheet_sheet/hr_timesheet_sheet.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index 93ef30e984b..5bddf20ae69 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -256,7 +256,8 @@ class account_analytic_account(osv.osv): def name_create(self, cr, uid, name, context=None): if context is None: context = {} - if not context.get('default_use_timesheets', False): + group_template_required = self.pool['res.users'].has_group(cr, uid, 'account_analytic_analysis.group_template_required') + if not context.get('default_use_timesheets', False) or group_template_required: return super(account_analytic_account, self).name_create(cr, uid, name, context=context) rec_id = self.create(cr, uid, {self._rec_name: name}, context) return self.name_get(cr, uid, [rec_id], context)[0]