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