fix permission

This commit is contained in:
Bakry 2024-09-02 10:01:20 +03:00
parent 70b2e3d0e2
commit 81f93aeef3
1 changed files with 3 additions and 2 deletions

View File

@ -285,7 +285,7 @@ class HrPersonalPermission(models.Model):
month_len = monthrange(current_year, current_month)[1]
number_of_per = item.employee_id.contract_id.working_hours.permission_number
number_of_durations = item.employee_id.contract_id.working_hours.permission_hours
this_month_permission = self.search([('employee_id', '=', item.employee_id.id), ('state', '=', 'approve'),
this_month_permission = self.search([('employee_id', '=', item.employee_id.id), ('state', 'in', ('send','approve')),
('date_from', '>=', time.strftime('%Y-{0}-1'.format(current_month))),
('date_to', '<=',
time.strftime('%Y-{0}-{1}'.format(current_month, month_len)))])
@ -298,7 +298,8 @@ class HrPersonalPermission(models.Model):
date_to = current_date.strftime('%Y-{0}-31'.format(current_month))
employee_permissions = self.search([
('employee_id', '=', item.employee_id.id),
('state', '=', 'approve'),
#('state', '=', 'approve'),
('state', 'in', ('send','approve') ),
('date_from', '>=', date_from),
('date_to', '<=', date_to)])