From ccb4e4332ece5c5d14f0f3ac38ff376a32fbe877 Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Wed, 14 Jan 2015 13:32:24 +0100 Subject: [PATCH] [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: - 4fb9c8f0dc60ddd209d1dc54e3fd95526d5c6def - 6c78541978336ae8ad4dc43f7051c19bf1ad4f7d Closes #4217 opw-620175 --- addons/hr_timesheet_sheet/hr_timesheet_sheet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index ea701d7b56a..31403af1ca6 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -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 \