fix
This commit is contained in:
parent
3d3778faf9
commit
0443c86479
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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') % (
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue