diff --git a/beesdoo_shift/models/cooperative_status.py b/beesdoo_shift/models/cooperative_status.py index f6ca088..76e2a3d 100644 --- a/beesdoo_shift/models/cooperative_status.py +++ b/beesdoo_shift/models/cooperative_status.py @@ -274,8 +274,16 @@ class CooperativeStatus(models.Model): journal = self.env['beesdoo.shift.journal'].search([('date', '=', today)]) if not journal: journal = self.env['beesdoo.shift.journal'].create({'date': today}) - - irregular = self.search([('status', '!=', 'unsubscribed'), ('working_mode', '=', 'irregular'), ('irregular_start_date', '!=', False)]) + domain = ['&', + '&', + '&', ('status', '!=', 'unsubscribed'), + ('working_mode', '=', 'irregular'), + ('irregular_start_date', '!=', False), + '|', + '|', ('holiday_start_time', '=', False), ('holiday_end_time', '=', False), + '|', ('holiday_start_time', '>', today), ('holiday_end_time', '<', today), + ] + irregular = self.search(domain) today_date = fields.Date.from_string(today) for status in irregular: if status.status == 'exempted':