HR_TIMESHEET_SHEET

bzr revid: fp@tinyerp.com-c933b8c634b44a56c328d5b88401984bd8202743
This commit is contained in:
Fabien Pinckaers 2007-04-11 05:51:27 +00:00
parent 3f63e5c22a
commit b6877ee0f1
2 changed files with 7 additions and 2 deletions

View File

@ -56,7 +56,7 @@
</group>
<button string="Sign In" name="sign_in" type="object"/>
<button string="Sign Out" name="sign_out" type="object"/>
<field name="attendances_ids" colspan="4" nolabel="1" context="name=date_current">
<field name="attendances_ids" colspan="4" nolabel="1" context="name=date_current" height="100">
<tree string="Attendances">
<field name="employee_id"/>
<field name="name"/>

View File

@ -32,10 +32,15 @@ import wizard
import netsvc
import time
import pooler
from osv import osv
class wiz_timesheet_open(wizard.interface):
def _open_timesheet(self, cr, uid, data, context):
ts = pooler.get_pool(cr.dbname).get('hr_timesheet_sheet.sheet')
pool = pooler.get_pool(cr.dbname)
user_ids = pool.get('hr.employee').search(cr, uid, [('user_id','=',uid)])
if not len(user_ids):
raise wizard.except_wizard('Error !', 'No employee defined for your user !')
ts = pool.get('hr_timesheet_sheet.sheet')
ids = ts.search(cr, uid, [('user_id','=',uid),('state','=','draft'),('date_from','<=',time.strftime('%Y-%m-%d')), ('date_to','>=',time.strftime('%Y-%m-%d'))])
view_type = 'form,tree'
if len(ids) > 1: