[FIX] hr_timesheet_sheet: prevent sheets overlaping

The constraint prevent sheets to overlap was broken because it relies on a check on the
user_id.  The problem is that the latter uses an old-api function field
that is not recomputed yet at the time of the validation.  The fix consists in
using a non-computed field instead.

This rev. is related to:
 - 4fb9c8f0dc
 - 6c78541978

Closes #4217
opw-620175
This commit is contained in:
Denis Ledoux 2015-01-14 13:32:24 +01:00
parent 8c3d71ccb8
commit ccb4e4332e
1 changed files with 1 additions and 1 deletions

View File

@ -219,7 +219,7 @@ class hr_timesheet_sheet(osv.osv):
def _sheet_date(self, cr, uid, ids, forced_user_id=False, context=None):
for sheet in self.browse(cr, uid, ids, context=context):
new_user_id = forced_user_id or sheet.user_id and sheet.user_id.id
new_user_id = forced_user_id or sheet.employee_id.user_id and sheet.employee_id.user_id.id
if new_user_id:
cr.execute('SELECT id \
FROM hr_timesheet_sheet_sheet \