add method for allow timesheet user

This commit is contained in:
Pawan Kumar 2021-01-21 16:48:53 +05:30
parent f01cb35b9c
commit 5709ed9d3a
1 changed files with 23 additions and 0 deletions

View File

@ -70,6 +70,29 @@ class Project(models.Model):
project_cons_hrs = fields.One2many('project.consultant.hrs', 'project_id', 'Consultant Allocation', copy=False)
comment = fields.Text(string='Comment')
# @api.onchange('allowed_internal_user_ids')
# def onchange_add_allowed_internal_users(self):
# user_list = []
# consultant_list = []
# employee_obj = []
# if self.allowed_internal_user_ids:
# user_list = self.allowed_internal_user_ids.ids
# if self.sale_line_employee_ids:
# for consultant in self.sale_line_employee_ids:
# consultant_list.append(consultant.employee_id.user_id.id)
# print('44444444444', user_list)
# print('5555555555', consultant_list)
# users = (set(user_list)) - (set(consultant_list))
# print('6666666666666666', users)
# for record in list(users):
# employee_obj = self.env['hr.employee'].search([('user_id', '=', record)]).ids
# if employee_obj:
# for employee in employee_obj:
# print('7777777777777', employee)
# self.sale_line_employee_ids.create({'project_id': self._origin.id,
# 'employee_id': employee})
def _onchange_calculate_timesheet_hours(self):
self.consultant_timesheet_hrs = [(6, 0, False)]
if self._origin.id: