[MERGE] forward port of branch 7.0 up to dd9d8b0

This commit is contained in:
Denis Ledoux 2015-02-09 12:14:09 +01:00
commit 9003537222
1 changed files with 2 additions and 1 deletions

View File

@ -294,7 +294,8 @@ class hr_timesheet_line(osv.osv):
for ts_line in self.browse(cursor, user, ids, context=context):
sheet_ids = sheet_obj.search(cursor, user,
[('date_to', '>=', ts_line.date), ('date_from', '<=', ts_line.date),
('employee_id.user_id', '=', ts_line.user_id.id)],
('employee_id.user_id', '=', ts_line.user_id.id),
('state', 'in', ['draft', 'new'])],
context=context)
if sheet_ids:
# [0] because only one sheet possible for an employee between 2 dates