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