[IMP] hr_holidays: show all employee leaves in Off Today
In the timeoff overview, the "Off Today" filter was only showing leaves that were occuring on the current day, hiding all the other leaves of the employee occuring that same period. Now it will display all the leaves for that period for the employees that are currently off. task-3098759 closes odoo/odoo#108290 Signed-off-by: Kevin Baptiste <kba@odoo.com>
This commit is contained in:
@@ -33,6 +33,8 @@ class LeaveReportCalendar(models.Model):
|
||||
is_hatched = fields.Boolean('Hatched', readonly=True)
|
||||
is_striked = fields.Boolean('Striked', readonly=True)
|
||||
|
||||
is_absent = fields.Boolean(related='employee_id.is_absent')
|
||||
|
||||
def init(self):
|
||||
tools.drop_view_if_exists(self._cr, 'hr_leave_report_calendar')
|
||||
self._cr.execute("""CREATE OR REPLACE VIEW hr_leave_report_calendar AS
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
domain="[('employee_id.member_of_department', '=', True)]"
|
||||
help="My Department"/>
|
||||
<separator/>
|
||||
<filter string="Off Today" name="off_today" domain="[('start_datetime', '<=', context_today().strftime('%Y-%m-%d')), ('stop_datetime', '>=', context_today().strftime('%Y-%m-%d'))]" help="My Department"/>
|
||||
<filter string="Off Today" name="off_today" domain="[('is_absent', '=', True)]" help="Employees Off Today"/>
|
||||
<separator/>
|
||||
<filter string="Approved" name="validate" domain="[('state', '=', 'validate')]" help="validate"/>
|
||||
<filter string="Waiting for Approval" name="approve" domain="[('state','in',('confirm','validate1'))]"/>
|
||||
|
||||
Reference in New Issue
Block a user