From c2719f0f8cd984db73cb9ca58907c7a53f7c700a Mon Sep 17 00:00:00 2001 From: skh Date: Fri, 15 Apr 2011 15:35:34 +0530 Subject: [PATCH] [FIX] Adding working time in a confirmed timesheet lp bug: https://launchpad.net/bugs/760493 fixed bzr revid: skh@tinyerp.com-20110415100534-g823ifs3sa7ufz4l --- addons/hr_timesheet_sheet/hr_timesheet_sheet.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index 4e5d8331441..6fca2b7e23e 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -493,21 +493,10 @@ class hr_timesheet_line(osv.osv): (_check_sheet_state, 'You can not modify an entry in a Confirmed/Done timesheet !.', ['state']), ] - def create(self, cr, uid, vals, *args, **kwargs): - if vals.get('sheet_id', False): - ts = self.pool.get('hr_timesheet_sheet.sheet').browse(cr, uid, vals['sheet_id']) - if not ts.state in ('draft', 'new'): - raise osv.except_osv(_('Error !'), _('You can not modify an entry in a confirmed timesheet !')) - return super(hr_timesheet_line,self).create(cr, uid, vals, *args, **kwargs) - def unlink(self, cr, uid, ids, *args, **kwargs): self._check(cr, uid, ids) return super(hr_timesheet_line,self).unlink(cr, uid, ids,*args, **kwargs) - def write(self, cr, uid, ids, *args, **kwargs): - self._check(cr, uid, ids) - return super(hr_timesheet_line,self).write(cr, uid, ids,*args, **kwargs) - def _check(self, cr, uid, ids): for att in self.browse(cr, uid, ids): if att.sheet_id and att.sheet_id.state not in ('draft', 'new'):