[MERGE]:merged from trunk
[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         <record id="hr_timesheet_line_tree" model="ir.ui.view">
9             <field name="name">hr.analytic.timesheet.tree</field>
10             <field name="model">hr.analytic.timesheet</field>
11             <field name="type">tree</field>
12             <field name="arch" type="xml">
13                 <tree editable="bottom" string="Timesheet Lines">
14                     <field name="date" on_change="on_change_date(date)"/>
15                     <field name="user_id" on_change="on_change_user_id(user_id)" required="1"/>
16                     <field name="journal_id" invisible="1"/>
17                     <field name="name"/>
18                     <field domain="[('type','=','normal')]" name="account_id"/>
19                     <field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" required="1" domain="[('type','=','service')]" invisible="1"/>
20                     <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" sum="Total time"/>
21                     <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" invisible="1"/>
22                     <field name="amount" sum="Total cost" invisible="1"/>
23                     <field name="general_account_id" invisible="1"/>
24                 </tree>
25             </field>
26         </record>
27         <record id="hr_timesheet_line_form" model="ir.ui.view">
28             <field name="name">hr.analytic.timesheet.form</field>
29             <field name="model">hr.analytic.timesheet</field>
30             <field name="type">form</field>
31             <field name="arch" type="xml">
32                 <form string="Timesheet Lines">
33                     <group colspan="4" col="6">
34                     <field 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                     </group>
38                     <notebook colspan="4">
39                         <page string="Information">
40                             <group colspan="2" col="2">
41                                 <separator string="Product" colspan="2"/>
42                                 <field name="product_id" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" required="1" domain="[('type','=','service')]"/>
43                                 <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)"/>
44                                 <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)"/>
45                             </group>
46                             <group colspan="2" col="2">
47                                 <separator string="Accounting" colspan="2"/>
48                                 <field domain="[('type','=','normal'),('state', '&lt;&gt;', 'close'),('parent_id','!=',False)]" name="account_id" select="1" groups="base.group_extended"/>
49                                 <field name="amount"/>
50                                 <field name="general_account_id"/>
51                                 <field name="journal_id"/>
52                             </group>
53                             <group colspan="2" col="2">
54                                 <separator string="Invoicing" colspan="2"/>
55                             </group>
56                         </page>
57                     </notebook>
58                 </form>
59             </field>
60         </record>
61
62         <record id="hr_timesheet_line_search" model="ir.ui.view">
63             <field name="name">hr.analytic.timesheet.search</field>
64             <field name="model">hr.analytic.timesheet</field>
65             <field name="type">search</field>
66             <field name="arch" type="xml">
67                 <search string="Timesheet">
68                     <group col='8' colspan='4'>
69                         <filter name="today" icon="terp-go-today" domain="[('date', '=', time.strftime('%%Y-%%m-%%d'))]" string="Today"/>
70                         <separator orientation="vertical"/>
71                         <field name="user_id"/>
72                         <field name="account_id"/>
73                         <field name="date"/>
74                     </group>
75                     <newline/>
76                     <group expand="0" string="Group By...">
77                         <filter string="Users" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
78                         <separator orientation="vertical"/>
79                         <filter string="Anlytic account" icon="terp-folder-green" domain="[]" context="{'group_by':'account_id'}"/>
80                         <filter string="Product" icon="terp-accessories-archiver" domain="[]" context="{'group_by':'product_id'}"/>
81                         <separator orientation="vertical"/>
82                         <filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'date'}"/>
83                     </group>
84                 </search>
85             </field>
86
87         </record>
88
89         <record id="act_hr_timesheet_line_evry1_all_form" model="ir.actions.act_window">
90             <field name="name">Working Hours</field>
91             <field name="type">ir.actions.act_window</field>
92             <field name="res_model">hr.analytic.timesheet</field>
93             <field name="view_type">form</field>
94             <field name="view_mode">tree,form</field>
95             <field name="context">{"search_default_user_id":uid, "search_default_today":1}</field>
96             <field name="search_view_id" ref="hr_timesheet_line_search"/>
97             <field name="help">Through Working Hours you can register your working hours by project every day.</field>
98         </record>
99
100     <menuitem id="menu_project_working_hours" parent="base.menu_project_management_time_tracking" action="act_hr_timesheet_line_evry1_all_form"/>
101     <menuitem id="menu_hr_working_hours" parent="hr_attendance.menu_hr_time_tracking" action="act_hr_timesheet_line_evry1_all_form"/>
102
103         <record id="hr_timesheet_employee_extd_form" model="ir.ui.view">
104             <field name="name">hr.timesheet.employee.extd_form</field>
105             <field name="model">hr.employee</field>
106             <field name="inherit_id" ref="hr.view_employee_form"/>
107             <field name="arch" type="xml">
108                 <page string="Categories" position="after">
109                     <page string="Timesheets">
110                         <field name="product_id" domain="[('type','=','service')]"/>
111                         <field name="journal_id" widget="selection"/>
112                     </page>
113                 </page>
114             </field>
115         </record>
116
117
118     </data>
119 </openerp>