uncomment onchange method

This commit is contained in:
pawan.sharma 2021-12-09 17:50:09 +05:30
parent 29eb86d6be
commit 696a762a13
3 changed files with 10 additions and 10 deletions

View File

@ -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',

View File

@ -9,4 +9,4 @@ from . import analytic
from . import product
from . import hr_employee
from . import sale
#from . import res_users
from . import res_users

View File

@ -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