From 75c16a19ccb94283f0897421db4fb5583cee2200 Mon Sep 17 00:00:00 2001 From: skh Date: Fri, 15 Apr 2011 14:44:28 +0530 Subject: [PATCH] [FIX] Adding working time in a confirmed timesheet lp bug: https://launchpad.net/bugs/760493 fixed bzr revid: skh@tinyerp.com-20110415091428-r9rm44mkdnjiwp9x --- addons/hr_timesheet_sheet/hr_timesheet_sheet.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index c65dc810c3e..4e5d8331441 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -484,14 +484,13 @@ class hr_timesheet_line(osv.osv): def _check_sheet_state(self, cr, uid, ids, context=None): if context is None: context = {} - line = self.browse(cr, uid, ids, context=context) - for timesheet in line: - if timesheet.sheet_id and timesheet.sheet_id.state not in ('draft', 'new'): + for timesheet_line in self.browse(cr, uid, ids, context=context): + if timesheet_line.sheet_id and timesheet_line.sheet_id.state not in ('draft', 'new'): return False return True _constraints = [ - (_check_sheet_state, 'You can not modify an entry in a confirmed timesheet !.', ['state']), + (_check_sheet_state, 'You can not modify an entry in a Confirmed/Done timesheet !.', ['state']), ] def create(self, cr, uid, vals, *args, **kwargs):