From 3962b7046b18f0bc5d5d55eb8868ee0af09380bb Mon Sep 17 00:00:00 2001 From: "pawan.sharma" Date: Thu, 9 Dec 2021 17:46:19 +0530 Subject: [PATCH] uncomment onchange method --- cor_custom/__manifest__.py | 2 +- cor_custom/models/__init__.py | 2 +- cor_custom/models/analytic.py | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cor_custom/__manifest__.py b/cor_custom/__manifest__.py index 8f05dd5..3a03896 100755 --- a/cor_custom/__manifest__.py +++ b/cor_custom/__manifest__.py @@ -31,7 +31,7 @@ 'views/project_view.xml', #'views/project_hours_view.xml', 'views/hr_employee_views.xml', - 'views/res_users.xml', + #'views/res_users.xml', 'views/hr_timesheet_templates.xml', 'views/analytic_view.xml', 'views/hide_menus.xml', 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 2d8dbed..46c7a62 100755 --- a/cor_custom/models/analytic.py +++ b/cor_custom/models/analytic.py @@ -140,14 +140,14 @@ 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: - # result = { - # 'domain': {'task_id': domain}, - # } - # else: - # result = { - # 'domain': {'task_id': domain, 'employee_id': [('id', 'in', project_all_emp_ids)]}, - # } + if self.env.user.update_timesheet == True: + result = { + 'domain': {'task_id': domain}, + } + else: + result = { + 'domain': {'task_id': domain, 'employee_id': [('id', 'in', project_all_emp_ids)]}, + } if self.project_id != self.task_id.project_id: # reset task when changing project self.task_id = False