Skip to Content
Menu
This question has been flagged
1 Reply
1203 Views

I'm trying to generate a leave report for each employee ,and its work properly when from date is in same month.

For example ,consider a employee X ,he take a leave from(29/5/2019)-to(4/7/2019)

While i take a report for a month june(ie, 6th month of 2019) , Nothing to show but he is leave june also,

and another situation is If one employee continuously leave for 3 months then how to track this in report.

my need is In this situation how to handle the search option


leave_obj = self.env['hr.holidays'].search([('type', '=', 'remove'),
('state', 'in', ['validate', 'confirm']),
('employee_id', '=', employee_id),
('from_date', ..................)])







Avatar
Discard
Best Answer

Hi this is already wriitren in hr_holiday module-

holidays = self.env['hr.holidays'].search([('employee_id', '=', empid), ('state', 'in', holiday_type), ('type', '=', 'remove'), ('date_from', '<=', str(end_date)), ('date_to', '>=', str(start_date)) ])

Avatar
Discard