Added timesheet improved
[odoo/odoo.git] / addons / hr_timesheet_sheet / hr_timesheet_sheet_view.xml
1 <?xml version="1.0" ?>
2 <terp>
3         <data>
4                 <record model="ir.ui.view" id="hr_timesheet_sheet_tree">
5                         <field name="name">hr.timesheet.sheet.tree</field>
6                         <field name="model">hr_timesheet_sheet.sheet</field>
7                         <field name="type">tree</field>
8                         <field name="arch" type="xml">
9                                 <tree string="Timesheet Sheet">
10                                         <field name="user_id"/>
11                                         <field name="date_from" />
12                                         <field name="date_to" />
13                                         <field name="name" />
14                                         <field name="total_attendance"/>
15                                         <field name="total_difference"/>
16                                         <field name="state"/>
17                                 </tree>
18                         </field>
19                 </record>
20
21
22                 <record model="ir.ui.view" id="hr_timesheet_sheet_form">
23                         <field name="name">hr.timesheet.sheet.form</field>
24                         <field name="model">hr_timesheet_sheet.sheet</field>
25                         <field name="type">form</field>
26                         <field name="arch" type="xml">
27                                 <form string="Timesheet Sheet">
28                                         <field name="name" />
29                                         <field name="user_id"/>
30                                         <field name="date_from" />
31                                         <field name="date_to" />
32
33                                         <notebook colspan="4">
34                                         <page string="Daily view">
35                                                 <group col="4" colspan="2">
36                                                         <field name="date_current" nolabel="1"/>
37                                                         <button string="&lt;&lt;" name="date_previous" type="object"/>
38                                                         <button string="GO" name="reload"/>
39                                                         <button string="&gt;&gt;" name="date_next" type="object"/>
40                                                 </group>
41                                                 <button string="Sign In" name="sign_in" type="object"/>
42                                                 <button string="Sign Out" name="sign_out" type="object"/>
43                                                 <field name="attendances_ids" colspan="4" nolabel="1">
44                                                         <tree string="Attendances" editable="bottom">
45                                                                 <field name="employee_id"/>
46                                                                 <field name="name"/>
47                                                                 <field name="action"/>
48                                                         </tree>
49                                                 </field>
50                                                 <label string=" " colspan="2"/>
51                                                 <field name="total_attendance_day"/>
52                                                 <field name="timesheet_ids" colspan="4" nolabel="1" domain="[('name','=',date_current)]">
53                                                         <tree string="Timesheet" editable="top">
54                                                                 <field name="user_id" required="1"/>
55                                                                 <field name="date" />
56                                                                 <field name="account_id" on_change="on_change_account_id(account_id)" domain="[('type','=','normal')]"/>
57                                                                 <field name="name" />
58                                                                 <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" />
59                                                                 <field name="product_id" invisible="True"/>
60                                                                 <field name="product_uom_id" invisible="True" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" />
61                                                                 <field name="amount" invisible="True"/>
62                                                                 <field name="general_account_id" invisible="True"/>
63                                                                 <field name="to_invoice"/>
64                                                         </tree>
65                                                 </field>
66                                                 <field name="total_difference_day"/>
67                                                 <field name="total_timesheet_day"/>
68                                                 <field name="state"/>
69                                                 <group col="4" colspan="2">
70                                                         <button string="Confirm" name="confirm" states="draft"/>
71                                                         <button string="Cancel" name="cancel" states="draft"/>
72                                                         <button string="Refuse" name="cancel" states="confirm"/>
73                                                         <button string="Accept" name="done" states="confirm"/>
74                                                 </group>
75                                         </page><page string="Global view">
76                                                 <field name="period_ids" colspan="4" nolabel="1">
77                                                         <tree string="Period" colors="red:total_difference&lt;=0.1;blue:total_difference&gt;=0.1">
78                                                                 <field name="name"/>
79                                                                 <field name="total_attendance"/>
80                                                                 <field name="total_timesheet"/>
81                                                                 <field name="total_difference"/>
82                                                         </tree>
83                                                 </field>
84                                                 <field name="total_attendance"/>
85                                                 <field name="total_timesheet"/>
86                                                 <field name="total_difference"/>
87                                         </page>
88                                         </notebook>
89                                 </form>
90                         </field>
91                 </record>
92
93                 <record model="ir.actions.act_window" id="act_hr_timesheet_sheet_form">
94                         <field name="name">hr.timesheet.sheet.form</field>
95                         <field name="type">ir.actions.act_window</field>
96                         <field name="res_model">hr_timesheet_sheet.sheet</field>
97                         <field name="view_type">form</field>
98                         <field name="view_id" ref="hr_timesheet_sheet_form" />
99                 </record>
100                 <menuitem name="Human Resources/Timesheets/All timesheets"
101                         id="menu_act_hr_timesheet_sheet_form"
102                         action="act_hr_timesheet_sheet_form" />
103
104                 <record model="ir.actions.act_window" id="act_hr_timesheet_sheet_form_my">
105                         <field name="name">hr.timesheet.sheet.form</field>
106                         <field name="type">ir.actions.act_window</field>
107                         <field name="res_model">hr_timesheet_sheet.sheet</field>
108                         <field name="domain">[('user_id','=',uid)]</field>
109                         <field name="view_type">form</field>
110                         <field name="view_mode">tree,form</field>
111                 </record>
112                 <menuitem name="Human Resources/Timesheets/My timesheets"
113                         id="menu_act_hr_timesheet_sheet_form_my"
114                         action="act_hr_timesheet_sheet_form_my" />
115
116                 <record model="ir.actions.act_window" id="act_hr_timesheet_sheet_form_my_confirm">
117                         <field name="name">hr.timesheet.sheet.form</field>
118                         <field name="type">ir.actions.act_window</field>
119                         <field name="res_model">hr_timesheet_sheet.sheet</field>
120                         <field name="domain">[('user_id','=',uid),('state','=','draft'),('date_to','&lt;=',time.strftime('%Y-%m-%d'))]</field>
121                         <field name="view_type">form</field>
122                         <field name="view_mode">tree,form</field>
123                 </record>
124                 <menuitem name="Human Resources/Timesheets/My timesheets/My timesheets to confirm"
125                         id="menu_act_hr_timesheet_sheet_form_my_confirm"
126                         action="act_hr_timesheet_sheet_form_my_confirm" />
127
128                 <wizard string="My current timesheet"
129                         model="hr.employee"
130                         name="hr_timesheet_sheet.current.open"
131                         id="act_hr_timesheet_sheet_form_my_current"/>
132                 <menuitem name="Human Resources/Timesheets/My timesheets/My current timesheet"
133                         id="menu_act_hr_timesheet_sheet_form_my_current"
134                         action="act_hr_timesheet_sheet_form_my_current"
135                         type="wizard"/>
136
137                 <record model="ir.actions.act_window" id="act_hr_timesheet_sheet_form_all_confirm">
138                         <field name="name">hr.timesheet.sheet.form</field>
139                         <field name="type">ir.actions.act_window</field>
140                         <field name="res_model">hr_timesheet_sheet.sheet</field>
141                         <field name="domain">[('state','=','draft'),('date_to','&lt;=',time.strftime('%Y-%m-%d'))]</field>
142                         <field name="view_type">form</field>
143                         <field name="view_mode">tree,form</field>
144                 </record>
145                 <menuitem name="Human Resources/Timesheets/All timesheets/Timesheets to confirm"
146                         id="menu_act_hr_timesheet_sheet_form_all_confirm"
147                         action="act_hr_timesheet_sheet_form_all_confirm" />
148
149                 <record model="ir.actions.act_window" id="act_hr_timesheet_sheet_form_all_valid">
150                         <field name="name">hr.timesheet.sheet.form</field>
151                         <field name="type">ir.actions.act_window</field>
152                         <field name="res_model">hr_timesheet_sheet.sheet</field>
153                         <field name="domain">[('state','=','confirm')]</field>
154                         <field name="view_type">form</field>
155                         <field name="view_mode">tree,form</field>
156                 </record>
157                 <menuitem name="Human Resources/Timesheets/All timesheets/Timesheets to validate"
158                         id="menu_act_hr_timesheet_sheet_form_all_valid"
159                         action="act_hr_timesheet_sheet_form_all_valid" />
160
161
162
163
164         </data>
165 </terp>