Skip to content

Commit

Permalink
[FIX] lp:1132963, Fix contract selection on payroll within date range
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCloneMaster authored and Stefan Rijnhart committed Jul 2, 2014
1 parent 323ccc1 commit 8be383b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/hr_payroll/hr_payroll.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ def get_contract(self, cr, uid, employee, date_from, date_to, context=None):
#OR if it starts between the given dates
clause_2 = ['&',('date_start', '<=', date_to),('date_start','>=', date_from)]
#OR if it starts before the date_from and finish after the date_end (or never finish)
clause_3 = [('date_start','<=', date_from),'|',('date_end', '=', False),('date_end','>=', date_to)]
clause_3 = ['&',('date_start','<=', date_from),'|',('date_end', '=', False),('date_end','>=', date_to)]
clause_final = [('employee_id', '=', employee.id),'|','|'] + clause_1 + clause_2 + clause_3
contract_ids = contract_obj.search(cr, uid, clause_final, context=context)
return contract_ids
Expand Down

0 comments on commit 8be383b

Please sign in to comment.