The default operator is deceptive in combined expressions (not fully shown in the diff):
Here is the full expression before the fix:
('employee_id', '=', employee.id), '|', '|' '&', ('date_end', '<=', date_to),('date_end','>=', date_from) '&', ('date_start', '<=', date_to),('date_start','>=', date_from) ('date_start','<=', date_from), '|', ('date_end', '=', False), ('date_end','>=', date_to)
The highest level, including the two '|' operators are governed by two implicit '&' operators, if I understand correctly.
After Mario's fix, the expression looks different:
('employee_id', '=', employee.id), '|', '|' '&', ('date_end', '<=', date_to),('date_end','>=', date_from) '&', ('date_start', '<=', date_to),('date_start','>=', date_from) '&', ('date_start','<=', date_from), '|', ('date_end', '=', False), ('date_end','>=', date_to)
Although it makes my brain hurt, this does validate contracts with an end date within the date range, so that it solves the bug.
« Back to merge proposal
The default operator is deceptive in combined expressions (not fully shown in the diff):
Here is the full expression before the fix:
('employee_id', '=', employee.id),
(' date_end' , '<=', date_to) ,('date_ end','> =', date_from)
(' date_start' , '<=', date_to) ,('date_ start', '>=', date_from) start', '<=', date_from), end','> =', date_to)
'|',
'|'
'&',
'&',
('date_
'|',
('date_end', '=', False),
('date_
The highest level, including the two '|' operators are governed by two implicit '&' operators, if I understand correctly.
After Mario's fix, the expression looks different:
('employee_id', '=', employee.id),
(' date_end' , '<=', date_to) ,('date_ end','> =', date_from)
(' date_start' , '<=', date_to) ,('date_ start', '>=', date_from)
('date_ start', '<=', date_from),
(' date_end' , '=', False),
(' date_end' ,'>=', date_to)
'|',
'|'
'&',
'&',
'&',
'|',
Although it makes my brain hurt, this does validate contracts with an end date within the date range, so that it solves the bug.