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