This commit is contained in:
Bakry 2024-10-14 16:08:44 +03:00
parent 3d3778faf9
commit 0443c86479
3 changed files with 3 additions and 3 deletions

View File

@ -20,7 +20,7 @@ class EmployeeHandoverReport(models.AbstractModel):
# domain += [('state','=','open')]
employees = self.env['hr.employee'].sudo().search(domain)
value = [('last_work_date', '>=', form['date_from']), ('create_date', '<=', form['date_to']),
('state', '!=', 'cancel')]
('state', '!=', 'refused')]
if employees:
value += [('employee_id', 'in', employees.ids)]
records = self.env['hr.termination'].sudo().search(value)

View File

@ -330,7 +330,7 @@ class HRHolidays(models.Model):
modules = Module.search([('state', '=', 'installed'), ('name', '=', 'hr_termination')])
if modules:
end_of_service_rec = self.env['hr.termination'].search(
[('employee_id', '=', rec.employee_id.id), ('state', 'not in', ('cancel', 'draft'))])
[('employee_id', '=', rec.employee_id.id), ('state', 'not in', ('refused', 'draft'))])
if end_of_service_rec and rec.type == 'remove':
raise exceptions.Warning(
_('Sorry ! you can not Create Holiday Request and there is an Employee Termination Request %s') % (

View File

@ -78,7 +78,7 @@ class HrTerminationReportView(models.AbstractModel):
termination_domain = [('employee_id', 'in', employee_ids),
('last_work_date', '>=', date_from), ('last_work_date', '<=', date_to),
('cause_type', '=', cause_type_id),
('state', 'not in', ['draft', 'cancel'])]
('state', 'not in', ['draft', 'refused'])]
for record in self.env['hr.termination'].search(termination_domain):
year = datetime.strptime(str(record.last_work_date), "%Y-%m-%d").year