[IMP] new menus
[odoo/odoo.git] / addons / hr_timesheet / hr_timesheet_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4         <record id="hr_timesheet_line_tree" model="ir.ui.view">
5             <field name="name">hr.analytic.timesheet.tree</field>
6             <field name="model">hr.analytic.timesheet</field>
7             <field name="type">tree</field>
8             <field name="arch" type="xml">
9                 <tree editable="bottom" string="Timesheet Line">
10                     <field name="user_id" on_change="on_change_user_id(user_id)" required="1"/>
11                     <field name="date" on_change="on_change_date(date)"/>
12                     <field domain="[('type','=','normal'),('state', '&lt;&gt;', 'close')]" name="account_id"/>
13                     <field name="name"/>
14                     <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" sum="Total time"/>
15                     <field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" required="1" domain="[('type','=','service')]"/>
16                     <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)"/>
17                     <field name="amount" sum="Total cost"/>
18                     <field name="general_account_id"/>
19                     <field name="journal_id"/>
20                 </tree>
21             </field>
22         </record>
23         <record id="hr_timesheet_line_form" model="ir.ui.view">
24             <field name="name">hr.analytic.timesheet.form</field>
25             <field name="model">hr.analytic.timesheet</field>
26             <field name="type">form</field>
27             <field name="arch" type="xml">
28                 <form string="Timesheet Lines">
29                     <field colspan="4" name="name" select="2"/>
30                     <field name="user_id" on_change="on_change_user_id(user_id)" required="1" select="1"/>
31                     <field name="date" select="1" on_change="on_change_date(date)"/>
32                     <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)"/>
33                     <newline/>
34                     <field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" required="1" domain="[('type','=','service')]"/>
35                     <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)"/>
36                     
37                     <field domain="[('type','=','normal'),('state', '&lt;&gt;', 'close')]" name="account_id" select="1"/>
38                     <field name="amount" select="2"/>
39                     <field name="general_account_id" select="2"/>
40                     <field name="journal_id"/>
41                 </form>
42             </field>
43         </record>
44         
45         <record id="hr_timesheet_line_search" model="ir.ui.view">
46             <field name="name">hr.analytic.timesheet.search</field>
47             <field name="model">hr.analytic.timesheet</field>
48             <field name="type">search</field>
49             <field name="arch" type="xml">
50                 <search string="Timesheet">
51                     <group col='8' colspan='4'>
52                             <filter icon="terp-hr" domain="[('date', '=', time.strftime('%%Y-%%m-%%d'))]" string="Today"/>
53                             <filter icon="terp-hr" domain="[('user_id','=',uid)]" string="My Work" help="My Work"/>
54                             <separator orientation="vertical"/>                    
55                             <field name="user_id" select="1" widget="selection"/>
56                             <field name="account_id" select="1" widget="selection"/>                    
57                             <field name="date" select="1"/>
58                     </group>
59                 </search>
60             </field>
61         </record>        
62
63         <menuitem id="menu_act_hr_timesheet_line_today_form" parent="hr.menu_hr_time" name="Working Hours" />
64         
65         <record id="act_hr_timesheet_line_evry1_all_form" model="ir.actions.act_window">
66             <field name="name">Working Hours</field>
67             <field name="type">ir.actions.act_window</field>
68             <field name="res_model">hr.analytic.timesheet</field>
69             <field name="view_type">form</field>
70             <field name="view_mode">tree,form</field>
71             <field name="search_view_id" ref="hr_timesheet_line_search"/>            
72         </record>
73         <menuitem
74             action="act_hr_timesheet_line_evry1_all_form"
75             id="menu_act_hr_timesheet_line_evry1_all_form"
76             parent="hr_timesheet.menu_act_hr_timesheet_line_today_form"
77             groups="hr.group_hr_manager"/>
78
79         <record id="hr_timesheet_employee_extd_form" model="ir.ui.view">
80             <field name="name">hr.timesheet.employee.extd_form</field>
81             <field name="model">hr.employee</field>
82             <field name="inherit_id" ref="hr.view_employee_form"/>
83             <field name="arch" type="xml">
84                 <notebook position="inside">
85                     <page string="Timesheets">
86                         <field name="product_id" domain="[('type','=','service')]"/>
87                         <field name="journal_id"/>
88                     </page>
89                 </notebook>
90             </field>
91         </record>
92     </data>
93 </openerp>