[Merge]: Merge with parent branch
[odoo/odoo.git] / addons / hr_timesheet_sheet / hr_timesheet_sheet_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4         <record id="hr_timesheet_sheet_tree" model="ir.ui.view">
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="Timesheets">
10                     <field name="user_id"/>
11                     <field name="date_from"/>
12                     <field name="date_to"/>
13                     <field name="name"/>
14                     <field name="total_attendance" groups="hr_attendance.group_hr_attendance"/>
15                     <field name="total_timesheet"/>
16                     <field name="total_difference" groups="hr_attendance.group_hr_attendance"/>
17                     <field name="state"/>
18                 </tree>
19             </field>
20         </record>
21         
22         <record id="hr_timesheet_account_form" model="ir.ui.view">
23             <field name="name">hr.timesheet.account.form</field>
24             <field name="model">hr_timesheet_sheet.sheet.account</field>
25             <field name="type">form</field>
26             <field name="arch" type="xml">
27                 <form string="Timesheet by Accounts">
28                     <field name="sheet_id" select="1"/>
29                     <field name="name" select="1"/>
30                     <field name="total" sum="Total"/>
31                     <field name="invoice_rate" select="2"/>
32                 </form>
33             </field>
34         </record>
35         
36         <record id="hr_timesheet_account_tree" model="ir.ui.view">
37             <field name="name">hr.timesheet.account.tree</field>
38             <field name="model">hr_timesheet_sheet.sheet.account</field>
39             <field name="type">tree</field>
40             <field name="arch" type="xml">
41                 <tree string="Timesheet by Accounts">
42                     <field name="sheet_id"/>
43                     <field name="name"/>
44                     <field name="total" sum="Total"/>
45                     <field name="invoice_rate"/>
46                 </tree>
47             </field>
48         </record>
49         
50         <record id="hr_timesheet_day_form" model="ir.ui.view">
51             <field name="name">hr.timesheet.day.form</field>
52             <field name="model">hr_timesheet_sheet.sheet.day</field>
53             <field name="type">form</field>
54             <field name="arch" type="xml">
55                 <form string="Timesheet by Days">
56                     <field name="sheet_id" select="1"/>
57                     <field name="name" select="1"/>
58                     <field name="total_timesheet"/>
59                     <field name="total_attendance" groups="hr_attendance.group_hr_attendance"/>
60                     <field name="total_difference" groups="hr_attendance.group_hr_attendance"/>
61                 </form>
62             </field>
63         </record>
64         
65         <record id="hr_timesheet_day_tree" model="ir.ui.view">
66             <field name="name">hr.timesheet.day.tree</field>
67             <field name="model">hr_timesheet_sheet.sheet.day</field>
68             <field name="type">tree</field>
69             <field name="arch" type="xml">
70                 <tree colors="red:total_difference&lt;=0.1;blue:total_difference&gt;=0.1" string="Timesheet by Days">
71                     <field name="sheet_id"/>
72                     <field name="name"/>
73                     <field name="total_timesheet" sum="Total Timesheet"/>
74                     <field name="total_attendance" sum="Total Attendance" groups="hr_attendance.group_hr_attendance"/>
75                     <field name="total_difference" sum="Total Difference" groups="hr_attendance.group_hr_attendance"/>
76                 </tree>
77             </field>
78         </record>
79         
80         <record id="hr_timesheet_sheet_form" model="ir.ui.view">
81             <field name="name">hr.timesheet.sheet.form</field>
82             <field name="model">hr_timesheet_sheet.sheet</field>
83             <field name="type">form</field>
84             <field name="arch" type="xml">
85                 <form string="Timesheet">
86                     <field name="name"/>
87                     <field name="user_id"/>
88                     <field name="date_from"/>
89                     <field name="date_to"/>
90                     <field name="company_id" select="1" groups="base.group_multi_company"/>
91                     <notebook colspan="4">
92                         <page string="Daily View">
93                             <group col="6" colspan="4">
94                                 <button name="button_dummy" string="Go to:" type="object" icon="gtk-redo"/>
95                                 <field name="date_current" nolabel="1"/>
96                                 <label string=""/>
97                                 <button icon="gtk-media-previous" name="date_previous" string="" type="object"/>
98                                 <button name="date_today" string="Today" type="object" icon="gtk-home"/>
99                                 <button icon="gtk-media-next" name="date_next" string="" type="object"/>
100                             </group>
101                             
102                             <field colspan="3" context="name=date_current,user_id=user_id" height="100" name="attendances_ids" nolabel="1" groups="hr_attendance.group_hr_attendance">
103                                 <tree string="Attendances">
104                                     <field name="name"/>
105                                     <field name="action"/>
106                                     <field invisible="1" name="employee_id"/>
107                                 </tree>
108                             </field>
109                             <group col="1" colspan="1" groups="hr_attendance.group_hr_attendance">
110                                 <button name="sign_in" string="Sign In" type="object" icon="gtk-go-back"/>
111                                 <button name="sign_out" string="Sign Out" type="object" icon="gtk-go-forward"/>
112                             </group>
113                             
114                             <field name="state_attendance" groups="hr_attendance.group_hr_attendance"/>
115                             <field name="total_attendance_day" widget="float_time" groups="hr_attendance.group_hr_attendance"/>
116                             <field colspan="4" context="date=date_current,user_id=user_id" domain="[('name','=',date_current)]" name="timesheet_ids" nolabel="1">
117                                 <tree editable="top" string="Timesheet">
118                                     <field invisible="1" name="date"/>
119                                     <field domain="[('type','=','normal'), ('state', '&lt;&gt;', 'close')]" name="account_id" on_change="on_change_account_id(account_id)"/>
120                                     <field name="name"/>
121                                     <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" widget="float_time"/>
122                                     <field name="to_invoice"/>
123                                     <field invisible="1" name="journal_id"/>
124                                     <field invisible="1" name="product_id"/>
125                                     <field invisible="1" name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)"/>
126                                     <field name="amount"/>
127                                     <field name="general_account_id"/>
128                                     <field invisible="1" name="user_id" required="1"/>
129                                 </tree>
130                                 <form string="Timesheet">
131                                     <field name="date"/>
132                                     <field domain="[('type','=','normal'), ('state', '&lt;&gt;', 'close')]" name="account_id" on_change="on_change_account_id(account_id)"/>
133                                     <field name="name"/>
134                                     <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)" widget="float_time"/>
135                                     <field name="to_invoice"/>
136                                     <field invisible="1" name="journal_id"/>
137                                     <field invisible="1" name="product_id"/>
138                                     <field invisible="1" name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, product_uom_id)"/>
139                                     <field name="amount"/>
140                                     <field name="general_account_id"/>
141                                     <field name="user_id" required="1"/>
142                                 </form>
143                             </field>
144                             <field name="total_difference_day" widget="float_time"/>
145                             <field name="total_timesheet_day" widget="float_time"/>
146                         </page>
147                         <page string="By Day">
148                             <field colspan="4" name="period_ids" nolabel="1">
149                                 <tree colors="red:total_difference&lt;=0.1;blue:total_difference&gt;=0.1" string="Period">
150                                     <field name="name"/>
151                                     <field name="total_attendance" widget="float_time" groups="hr_attendance.group_hr_attendance"/>
152                                     <field name="total_timesheet" widget="float_time"/>
153                                     <field name="total_difference" widget="float_time" groups="hr_attendance.group_hr_attendance"/>
154                                 </tree>
155                             </field>
156                             <field name="total_attendance" widget="float_time"/>
157                             <field name="total_timesheet" widget="float_time"/>
158                             <field name="total_difference" widget="float_time"/>
159                         </page>
160                     </notebook>
161                     <field name="state"/>
162                     <group col="4" colspan="2">
163                         <button name="button_confirm" states="draft" string="Confirm" type="object" icon="gtk-execute"/>
164                         <button name="action_set_to_draft" states="done" string="Set to Draft" type="object" icon="gtk-convert"/>
165                         <button name="cancel" states="confirm" string="Refuse" icon="gtk-stop"/>
166                         <button name="done" states="confirm" string="Accept" icon="gtk-apply"/>
167                     </group>
168                 </form>
169             </field>
170         </record>
171
172         <record id="view_hr_timesheet_sheet_filter" model="ir.ui.view">
173             <field name="name">hr_timesheet_sheet.sheet.filter</field>
174             <field name="model">hr_timesheet_sheet.sheet</field>
175             <field name="type">search</field>
176             <field name="arch" type="xml">
177                 <search string="Search Timesheet">
178                    <group col='8' colspan='4'>
179                            <filter icon="terp-partner" string="My Timesheets" domain="[('user_id','=',uid)]" help="My Timesheet"/>
180                            <filter icon="terp-crm" string="My departments timesheets"  domain="[('user_id', 'child_of', [uid])]" help="My Departments Timesheet"/>
181                                                 <separator orientation="vertical"/>
182                        <field name="state">
183                            <filter icon="terp-hr" domain="[('state','=','draft')]" help="Draft Timesheets"/>
184                            <filter icon="terp-hr" domain="[('state','=','confirm')]" help="Confirmed Timesheets"/>
185                        </field>
186                        <field name="name" select='1'/>
187                        <field name="user_id" select="1" widget="selection">
188                        </field>                       
189                    </group>
190                </search>
191             </field>
192         </record>
193         
194         <record id="act_hr_timesheet_sheet_form" model="ir.actions.act_window">
195             <field name="name">Timesheets</field>
196             <field name="type">ir.actions.act_window</field>
197             <field name="res_model">hr_timesheet_sheet.sheet</field>
198             <field name="view_type">form</field>
199             <field name="view_id" eval="False"/>
200             <field name="search_view_id" ref="view_hr_timesheet_sheet_filter"/>            
201         </record>
202         <menuitem id="next_id_60" name="Timesheets" parent="hr.menu_hr_root"/>
203         <menuitem action="act_hr_timesheet_sheet_form" id="menu_act_hr_timesheet_sheet_form" parent="next_id_60"
204             groups="hr.group_hr_manager"/>
205         
206         <record id="act_hr_timesheet_sheet_form_my" model="ir.actions.act_window">
207             <field name="name">My timesheets</field>
208             <field name="type">ir.actions.act_window</field>
209             <field name="res_model">hr_timesheet_sheet.sheet</field>
210             <field name="domain">[('user_id','=',uid)]</field>
211             <field name="view_type">form</field>
212             <field name="view_mode">tree,form</field>
213             <field name="filter" eval="True"/>
214             <field name="search_view_id" ref="view_hr_timesheet_sheet_filter"/>            
215         </record>
216         <menuitem action="act_hr_timesheet_sheet_form_my" id="menu_act_hr_timesheet_sheet_form_my" parent="hr_timesheet_sheet.next_id_60" groups="base.group_extended"/>
217         
218         <record id="act_hr_timesheet_sheet_form_my_confirm" model="ir.actions.act_window">
219             <field name="name">My timesheets to confirm</field>
220             <field name="type">ir.actions.act_window</field>
221             <field name="res_model">hr_timesheet_sheet.sheet</field>
222             <field name="domain">[('user_id','=',uid),('state','=','draft'),('date_to','&lt;=',time.strftime('%Y-%m-%d'))]</field>
223             <field name="view_type">form</field>
224             <field name="view_mode">tree,form</field>
225             <field name="filter" eval="True"/>
226             <field name="search_view_id" ref="view_hr_timesheet_sheet_filter"/>
227         </record>
228
229         <record id="act_hr_timesheet_sheet_form_my_department" model="ir.actions.act_window">
230             <field name="name">My Department's Timesheets</field>
231             <field name="type">ir.actions.act_window</field>
232             <field name="res_model">hr_timesheet_sheet.sheet</field>
233             <field name="domain">[('user_id', 'child_of', [uid])]</field>
234             <field name="view_type">form</field>
235             <field name="view_mode">tree,form</field>
236             <field name="filter" eval="True"/>
237             <field name="search_view_id" ref="view_hr_timesheet_sheet_filter"/>
238         </record>
239         <menuitem action="act_hr_timesheet_sheet_form_my_department" id="menu_act_hr_timesheet_sheet_form_my_department" parent="hr_timesheet_sheet.next_id_60" groups="base.group_extended"/>
240
241         <record id="act_hr_timesheet_sheet_form_my_confirm_department" model="ir.actions.act_window">
242             <field name="name">My Department's Timesheets to Confirm</field>
243             <field name="type">ir.actions.act_window</field>
244             <field name="res_model">hr_timesheet_sheet.sheet</field>
245             <field name="domain">[('user_id', 'child_of', [uid]),('state','=','draft'),('date_to','&lt;=',time.strftime('%Y-%m-%d'))]</field>
246             <field name="view_type">form</field>
247             <field name="view_mode">tree,form</field>
248             <field name="filter" eval="True"/>
249             <field name="search_view_id" ref="view_hr_timesheet_sheet_filter"/>
250         </record>
251
252         <record id="act_hr_timesheet_sheet_form_my_validate_department" model="ir.actions.act_window">
253             <field name="name">My Department's Timesheets to Validate</field>
254             <field name="type">ir.actions.act_window</field>
255             <field name="res_model">hr_timesheet_sheet.sheet</field>
256             <field name="domain">[('user_id', 'child_of', [uid]),('state','=','confirm'),('date_to','&lt;=',time.strftime('%Y-%m-%d'))]</field>
257             <field name="view_type">form</field>
258             <field name="view_mode">tree,form</field>
259             <field name="filter" eval="True"/>
260             <field name="search_view_id" ref="view_hr_timesheet_sheet_filter"/>
261         </record>
262         
263         <wizard id="act_hr_timesheet_sheet_form_my_current" model="hr.employee" name="hr_timesheet_sheet.current.open" string="My Current Timesheet"/>
264
265         <menuitem action="act_hr_timesheet_sheet_form_my_current" icon="STOCK_NEW" id="menu_act_hr_timesheet_sheet_form_my_current" parent="hr_timesheet_sheet.menu_act_hr_timesheet_sheet_form_my" type="wizard"/>
266         
267         <record id="act_hr_timesheet_sheet_form_all_confirm" model="ir.actions.act_window">
268             <field name="name">Timesheets To Confirm</field>
269             <field name="type">ir.actions.act_window</field>
270             <field name="res_model">hr_timesheet_sheet.sheet</field>
271             <field name="domain">[('state','=','draft'),('date_to','&lt;=',time.strftime('%Y-%m-%d'))]</field>
272             <field name="view_type">form</field>
273             <field name="view_mode">tree,form</field>
274             <field name="filter" eval="True"/>
275             <field name="search_view_id" ref="view_hr_timesheet_sheet_filter"/>            
276         </record>
277         <record id="act_hr_timesheet_sheet_form_all_valid" model="ir.actions.act_window">
278             <field name="name">Timesheets To Validate</field>
279             <field name="type">ir.actions.act_window</field>
280             <field name="res_model">hr_timesheet_sheet.sheet</field>
281             <field name="domain">[('state','=','confirm')]</field>
282             <field name="view_type">form</field>
283             <field name="view_mode">tree,form</field>
284             <field name="filter" eval="True"/>
285             <field name="search_view_id" ref="view_hr_timesheet_sheet_filter"/>            
286         </record>
287         
288         <!--
289             Company inheritancy
290         -->
291         
292         <record id="hr_timesheet_sheet_company" model="ir.ui.view">
293             <field name="name">res.company.sheet</field>
294             <field name="model">res.company</field>
295             <field name="type">form</field>
296             <field name="inherit_id" ref="base.view_company_form"/>
297             <field name="arch" type="xml">
298                 <page string="Configuration" position="inside">
299                     <separator string="Timesheets" colspan="4"/>
300                     <field name="timesheet_range"/>
301                     <field name="timesheet_max_difference"/>
302                     <newline/>
303                 </page>
304             </field>
305         </record>
306         
307         <!--
308             hr.analytic.timesheet inheritancy
309         -->
310         
311         <record id="hr_timesheet_line_form" model="ir.ui.view">
312             <field name="name">hr.analytic.timesheet.form</field>
313             <field name="model">hr.analytic.timesheet</field>
314             <field name="type">form</field>
315             <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/>
316             <field name="arch" type="xml">
317                 <field name="date" position="after">
318                     <field name="sheet_id" select="2"/>
319                 </field>
320             </field>
321         </record>
322         <!--
323             hr.attendance inheritancy
324         -->
325         
326         <record id="view_attendance_form" model="ir.ui.view">
327             <field name="name">hr.attendance.form</field>
328             <field name="model">hr.attendance</field>
329             <field name="type">form</field>
330             <field name="inherit_id" ref="hr_attendance.view_attendance_form"/>
331             <field name="arch" type="xml">
332                 <field name="action_desc" position="after">
333                     <field name="sheet_id" select="2"/>
334                 </field>
335             </field>
336         </record>
337         <record id="view_attendance_tree" model="ir.ui.view">
338             <field name="name">hr.attendance.tree</field>
339             <field name="model">hr.attendance</field>
340             <field name="type">tree</field>
341             <field name="inherit_id" ref="hr_attendance.view_attendance_tree"/>
342             <field name="arch" type="xml">
343                 <field name="action_desc" position="after">
344                     <field name="sheet_id"/>
345                 </field>
346             </field>
347         </record>
348         
349         <act_window domain="[('sheet_id', '=', active_id)]" id="act_hr_timesheet_sheet_sheet_by_day" name="Timesheet by Account" res_model="hr_timesheet_sheet.sheet.account" src_model="hr_timesheet_sheet.sheet"/>
350         <act_window domain="[('sheet_id', '=', active_id)]" id="act_hr_timesheet_sheet_sheet_by_account" name="Timesheet by Day" res_model="hr_timesheet_sheet.sheet.day" src_model="hr_timesheet_sheet.sheet"/>
351         
352         
353         <act_window domain="[('sheet_id', '=', active_id)]" id="act_hr_timesheet_sheet_sheet_2_hr_analytic_timesheet" name="Timesheet Lines" res_model="hr.analytic.timesheet" src_model="hr_timesheet_sheet.sheet"/>
354         
355         <act_window domain="[('sheet_id', '=', active_id)]" id="act_hr_timesheet_sheet_sheet_2_hr_attendance" name="Attendances" res_model="hr.attendance" src_model="hr_timesheet_sheet.sheet"/>
356         
357         <record id="hr_timesheet_sheet_tree_simplified" model="ir.ui.view">
358             <field name="name">hr.timesheet.sheet.tree.simplified</field>
359             <field name="model">hr_timesheet_sheet.sheet</field>
360             <field name="type">tree</field>
361             <field eval="20" name="priority"/>
362             <field name="arch" type="xml">
363                 <tree string="Timesheets">
364                     <field name="date_from"/>
365                     <field name="user_id"/>
366                     <field name="name"/>
367                     <field name="total_attendance"/>
368                     <field name="total_timesheet"/>
369                     <field name="state"/>
370                 </tree>
371             </field>
372         </record>
373         
374         <record id="act_hr_timesheet_sheet_unvalidate" model="ir.actions.act_window">
375             <field name="name">Unvalidated Timesheets</field>
376             <field name="res_model">hr_timesheet_sheet.sheet</field>
377             <field name="domain">[('state','&lt;&gt;','done'),('date_to','&lt;',time.strftime('%Y-%m-%d'))]</field>
378             <field name="view_type">form</field>
379             <field name="view_id" ref="hr_timesheet_sheet_tree_simplified"/>
380             <field name="filter" eval="True"/>
381             <field name="search_view_id" ref="view_hr_timesheet_sheet_filter"/>            
382         </record>
383         
384     </data>
385 </openerp>