HR_TIMESHEET_SHEET: fix goto button out of constraint

bzr revid: ced-b29b380fce0d75170f65d5a4ae0b0f3227e97ae6
This commit is contained in:
ced 2007-05-07 05:30:24 +00:00
parent f8bed58f0d
commit 72aac92732
1 changed files with 5 additions and 0 deletions

View File

@ -188,6 +188,11 @@ class hr_timesheet_sheet(osv.osv):
})
return True
def button_dummy(self, cr, uid, ids, context):
for sheet in self.browse(cr, uid, ids, context):
if DateTime.strptime(sheet.date_current, '%Y-%m-%d') <= DateTime.strptime(sheet.date_from, '%Y-%m-%d'):
self.write(cr, uid, [sheet.id], {'date_current': sheet.date_from,})
elif DateTime.strptime(sheet.date_current, '%Y-%m-%d') >= DateTime.strptime(sheet.date_to, '%Y-%m-%d'):
self.write(cr, uid, [sheet.id], {'date_current': sheet.date_to,})
return True
def sign_in(self, cr, uid, ids, context):