[MOD]hr_*: usability improvement
[odoo/odoo.git] / addons / hr_timesheet / hr_timesheet_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4         <menuitem icon="terp-project" id="base.menu_main_pm" name="Project" sequence="10"/>
5         <menuitem id="base.menu_project_management_time_tracking" name="Time Tracking"
6                   parent="base.menu_main_pm" sequence="3"/>
7
8
9         <record id="hr_timesheet_line_tree" model="ir.ui.view">
10             <field name="name">hr.analytic.timesheet.tree</field>
11             <field name="model">hr.analytic.timesheet</field>
12             <field name="type">tree</field>
13             <field name="arch" type="xml">
14                 <tree editable="bottom" string="Timesheet Lines">
15                     <field name="user_id" on_change="on_change_user_id(user_id)" required="1"/>
16                     <field name="date" on_change="on_change_date(date)"/>
17                     <field domain="[('type','=','normal'),('state', '&lt;&gt;', 'close')]" name="account_id"/>
18                     <field name="name"/>
19                     <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" sum="Total time"/>
20                     <field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" required="1" domain="[('type','=','service')]"/>
21                     <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)"/>
22                     <field name="amount" sum="Total cost"/>
23                     <field name="general_account_id"/>
24                     <field name="journal_id"/>
25                 </tree>
26             </field>
27         </record>
28         <record id="hr_timesheet_line_form" model="ir.ui.view">
29             <field name="name">hr.analytic.timesheet.form</field>
30             <field name="model">hr.analytic.timesheet</field>
31             <field name="type">form</field>
32             <field name="arch" type="xml">
33                 <form string="Timesheet Lines">
34                     <field colspan="4" name="name"/>
35                     <field name="user_id" on_change="on_change_user_id(user_id)" required="1" select="1"/>
36                     <field name="date" select="1" on_change="on_change_date(date)"/>
37                     <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)"/>
38                     <newline/>
39                     <field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" required="1" domain="[('type','=','service')]"/>
40                     <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)"/>
41                     <field domain="[('type','=','normal'),('state', '&lt;&gt;', 'close'),('parent_id','!=',False)]" name="account_id" select="1" groups="base.group_extended"/>
42                     <field name="amount"/>
43                     <field name="general_account_id"/>
44                     <field name="journal_id"/>
45                 </form>
46             </field>
47         </record>
48
49         <record id="hr_timesheet_line_search" model="ir.ui.view">
50             <field name="name">hr.analytic.timesheet.search</field>
51             <field name="model">hr.analytic.timesheet</field>
52             <field name="type">search</field>
53             <field name="arch" type="xml">
54                 <search string="Timesheet">
55                     <group col='8' colspan='4'>
56                         <filter icon="terp-personal+"
57                                 domain="[('user_id','=',uid)]"
58                                 string="My Working Hours" name="my" default="1"/>
59                         <separator orientation="vertical"/>
60                         <filter icon="terp-go-today" domain="[('date', '=', time.strftime('%%Y-%%m-%%d'))]" string="Today"/>
61                         <separator orientation="vertical"/>
62                         <field name="user_id"/>
63                         <field name="account_id" select="1" widget="selection"/>
64                         <field name="product_id" select="1"/>
65                         <field name="date" select="1"/>
66                     </group>
67                     <newline/>
68                     <group expand="0" string="Group By...">
69                         <filter string="Users" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
70                         <filter string="Anlytic account" icon="terp-personal+" domain="[]" context="{'group_by':'account_id'}"/>
71                         <separator orientation="vertical"/>                        
72                         <filter string="Product" icon="terp-personal" domain="[]" context="{'group_by':'product_id'}"/>
73                         <filter string="Date" icon="terp-personal+" domain="[]" context="{'group_by':'date'}"/>                        
74                     </group>                     
75                 </search>
76             </field>
77
78         </record>
79
80         <record id="act_hr_timesheet_line_me_all_form" model="ir.actions.act_window">
81             <field name="name">My Working Hours</field>
82             <field name="type">ir.actions.act_window</field>
83             <field name="res_model">hr.analytic.timesheet</field>
84             <field name="view_type">form</field>
85             <field name="view_mode">tree,form</field>
86             <field name="domain">[('user_id','=',uid)]</field>
87             <field name="filter" eval="True"/>
88             <field name="context">{"search_default_user_id":uid, "search_default_my": 1}</field>
89             <field name="search_view_id" ref="hr_timesheet_line_search"/>
90         </record>
91
92         <record id="act_hr_timesheet_line_evry1_all_form" model="ir.actions.act_window">
93             <field name="name">Working Hours</field>
94             <field name="type">ir.actions.act_window</field>
95             <field name="res_model">hr.analytic.timesheet</field>
96             <field name="view_type">form</field>
97             <field name="view_mode">tree,form</field>
98             <field name="context">{"search_default_user_id":uid}</field>
99             <field name="search_view_id" ref="hr_timesheet_line_search"/>
100             <field name="help">This functionality gives you a list of work done by user, product and analytic account (or project). A search tool allows you to make fine-grained analysis.</field>
101         </record>
102
103     <menuitem id="menu_project_working_hours" parent="base.menu_project_management_time_tracking" action="act_hr_timesheet_line_evry1_all_form"/>
104     <menuitem id="menu_hr_working_hours" parent="hr_attendance.menu_hr_time_tracking" action="act_hr_timesheet_line_evry1_all_form"/>
105
106         <record id="hr_timesheet_employee_extd_form" model="ir.ui.view">
107             <field name="name">hr.timesheet.employee.extd_form</field>
108             <field name="model">hr.employee</field>
109             <field name="inherit_id" ref="hr.view_employee_form"/>
110             <field name="arch" type="xml">
111                 <page string="Categories" position="after">
112                     <page string="Timesheets">
113                         <field name="product_id" domain="[('type','=','service')]"/>
114                         <field name="journal_id"/>
115                     </page>
116                 </page>
117             </field>
118         </record>
119
120
121     </data>
122 </openerp>