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