[IMP] hr_timesheet_sheet : set a server action for my timesheet menu
bzr revid: vir@tinyerp.com-20101013120039-b4ffcjiv26koodwu
This commit is contained in:
parent
5b2361fbbd
commit
4b0c69ab39
|
@ -49,13 +49,14 @@ The validation can be configured in the company:
|
|||
'init_xml': [],
|
||||
'update_xml': [
|
||||
'security/ir.model.access.csv',
|
||||
'security/hr_timesheet_data.xml',
|
||||
'security/hr_timesheet_sheet_security.xml',
|
||||
'hr_timesheet_sheet_view.xml',
|
||||
'hr_timesheet_workflow.xml',
|
||||
'process/hr_timesheet_sheet_process.xml',
|
||||
'board_hr_timesheet_view.xml',
|
||||
'report/hr_timesheet_report_view.xml',
|
||||
'wizard/hr_timesheet_current_view.xml',
|
||||
'hr_timesheet_sheet_data.xml'
|
||||
],
|
||||
'demo_xml': ['hr_timesheet_sheet_demo.xml',
|
||||
|
||||
|
|
|
@ -334,11 +334,16 @@ class hr_timesheet_sheet(osv.osv):
|
|||
return time.strftime('%Y-12-31')
|
||||
return time.strftime('%Y-%m-%d')
|
||||
|
||||
def _default_employee(self,cr, uid, context=None):
|
||||
emp_ids = self.pool.get('hr.employee').search(cr, uid, [('user_id','=',uid)], context=context)
|
||||
return emp_ids and emp_ids[0] or False
|
||||
|
||||
_defaults = {
|
||||
'date_from' : _default_date_from,
|
||||
'date_current' : lambda *a: time.strftime('%Y-%m-%d'),
|
||||
'date_to' : _default_date_to,
|
||||
'state': 'new',
|
||||
'employee_id': _default_employee,
|
||||
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'hr_timesheet_sheet.sheet', context=c)
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" ?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="ir_actions_server_timsheet_sheet" model="ir.actions.server">
|
||||
<field eval="5" name="sequence"/>
|
||||
<field eval=""""code"""" name="state"/>
|
||||
<field eval=""""ir.actions.server"""" name="type"/>
|
||||
<field name="model_id" ref="model_hr_timesheet_current_open"/>
|
||||
<field eval="[(6,0,[])]" name="child_ids"/>
|
||||
<field eval=""""action = self.pool.get('hr.timesheet.current.open').open_timesheet(cr, uid, object.id, context)"""" name="code"/>
|
||||
<field eval=""""True"""" name="condition"/>
|
||||
<field eval=""""My Timesheet"""" name="name"/>
|
||||
</record>
|
||||
|
||||
<record id="menu_act_hr_timesheet_sheet_form_my_current" model="ir.ui.menu">
|
||||
<field name="name">My Timesheet</field>
|
||||
<field eval="1" name="sequence"/>
|
||||
<field name="parent_id" ref="hr_attendance.menu_hr_time_tracking"/>
|
||||
<field name="icon">STOCK_JUSTIFY_FILL</field>
|
||||
<field name="action" ref="ir_actions_server_timsheet_sheet"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
Loading…
Reference in New Issue