From 1e44c2934dca871e9297cd77b43c1adfddd91fb3 Mon Sep 17 00:00:00 2001 From: "pawan.sharma" Date: Thu, 9 Dec 2021 18:48:57 +0530 Subject: [PATCH] change logic for boolean to group --- cor_custom/models/__init__.py | 2 +- cor_custom/models/analytic.py | 2 +- cor_custom/models/res_users.py | 1 - cor_custom/views/res_users.xml | 15 ++------------- 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/cor_custom/models/__init__.py b/cor_custom/models/__init__.py index 6b52d03..fc17eb2 100755 --- a/cor_custom/models/__init__.py +++ b/cor_custom/models/__init__.py @@ -9,4 +9,4 @@ from . import analytic from . import product from . import hr_employee from . import sale -from . import res_users \ No newline at end of file +#from . import res_users \ No newline at end of file diff --git a/cor_custom/models/analytic.py b/cor_custom/models/analytic.py index 46c7a62..e082d91 100755 --- a/cor_custom/models/analytic.py +++ b/cor_custom/models/analytic.py @@ -140,7 +140,7 @@ class AccountAnalyticLine(models.Model): user_ids = self.env['hr.employee'].search( [('user_id', 'in', self.project_id.allowed_internal_user_ids.ids)]).ids project_all_emp_ids = cuser + manager_id + user_ids + consul_project_ids - if self.env.user.update_timesheet == True: + if self.env.user.user_has_groups('cor_custom.group_update_timesheet'): result = { 'domain': {'task_id': domain}, } diff --git a/cor_custom/models/res_users.py b/cor_custom/models/res_users.py index 2442fba..b675306 100755 --- a/cor_custom/models/res_users.py +++ b/cor_custom/models/res_users.py @@ -6,6 +6,5 @@ class CorResUsers(models.Model): _inherit = "res.users" _description = "Custom Res Users" - update_timesheet = fields.Boolean() diff --git a/cor_custom/views/res_users.xml b/cor_custom/views/res_users.xml index aabd224..c3fa466 100755 --- a/cor_custom/views/res_users.xml +++ b/cor_custom/views/res_users.xml @@ -1,18 +1,7 @@ - - - - res.users - - - - - - - - - + + Update Timesheet \ No newline at end of file