</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"/>
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: