[FIX] Adding working time in a confirmed timesheet

lp bug: https://launchpad.net/bugs/760493 fixed

bzr revid: skh@tinyerp.com-20110415091428-r9rm44mkdnjiwp9x
This commit is contained in:
skh 2011-04-15 14:44:28 +05:30
parent 6b83b67f60
commit 75c16a19cc
1 changed files with 3 additions and 4 deletions

View File

@ -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):