1 <?xml version="1.0" encoding="utf-8"?>
5 <record id="hr_timesheet_account_form" model="ir.ui.view">
6 <field name="name">hr.timesheet.account.form</field>
7 <field name="model">hr_timesheet_sheet.sheet.account</field>
8 <field name="type">form</field>
9 <field name="arch" type="xml">
10 <form string="Timesheet by Accounts" version="7.0">
12 <field name="sheet_id"/>
13 <field name="name" groups="analytic.group_analytic_accounting"/>
14 <field name="total" sum="Total"/>
15 <field name="invoice_rate"/>
20 <record id="hr_timesheet_account_filter" model="ir.ui.view">
21 <field name="name">hr.timesheet.account.filter</field>
22 <field name="model">hr_timesheet_sheet.sheet.account</field>
23 <field name="type">search</field>
24 <field name="arch" type="xml">
25 <search string="Search Account">
26 <field name="name" groups="analytic.group_analytic_accounting"/>
27 <field name="invoice_rate"/>
28 <field name="sheet_id" />
32 <record id="hr_timesheet_account_tree" model="ir.ui.view">
33 <field name="name">hr.timesheet.account.tree</field>
34 <field name="model">hr_timesheet_sheet.sheet.account</field>
35 <field name="type">tree</field>
36 <field name="arch" type="xml">
37 <tree string="Timesheet by Accounts">
38 <field name="sheet_id"/>
39 <field name="name" groups="analytic.group_analytic_accounting"/>
40 <field name="total" sum="Total"/>
41 <field name="invoice_rate"/>
46 <record id="hr_timesheet_sheet_form" model="ir.ui.view">
47 <field name="name">hr.timesheet.sheet.form</field>
48 <field name="model">hr_timesheet_sheet.sheet</field>
49 <field name="type">form</field>
50 <field name="arch" type="xml">
51 <form string="Timesheet" version="7.0">
53 <button name="button_confirm" states="draft" string="Submited to Manager" type="object" class="oe_highlight"/>
54 <button name="done" states="confirm" string="Approve" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
55 <button name="action_set_to_draft" states="done" string="Set to Draft" type="object" />
56 <button name="cancel" states="confirm" string="Refuse" type="workflow" groups="base.group_hr_user" />
57 <field name="state" widget="statusbar" statusbar_visible="new,confirm,done"/>
60 <label for="employee_id" class="oe_edit_only"/>
61 <h1><field name="employee_id" on_change="onchange_employee_id(employee_id)"/></h1>
62 <label for="date_from" class="oe_edit_only" string="Timesheet Period"/>
63 <h2>From <field name="date_from"/> to <field name="date_to"/></h2>
67 <field name="department_id"/>
68 <field name="company_id" groups="base.group_multi_company"/>
71 <field name="total_attendance" widget="float_time"/>
72 <field name="total_timesheet" widget="float_time"/>
73 <field name="total_difference" widget="float_time"/>
74 <field name="user_id" invisible="1" options='{"no_open": true}'/>
81 <button name="button_dummy" class="oe_inline" string="Go to" type="object" icon="terp-gtk-jump-to-ltr"/> :
82 <field name="date_current" class="oe_inline"/>
85 <button class="oe_inline" icon="terp-gtk-go-back-ltr" name="date_previous" string="" type="object"/>
86 <button class="oe_inline" name="date_today" string="Today" type="object" icon="terp-go-today"/>
87 <button class="oe_inline" icon="terp-gtk-go-back-rtl" name="date_next" string="" type="object"/>
90 <group colspan="4" col="3">
91 <field context="{'name':date_current,'user_id':user_id}" name="attendances_ids" nolabel="1">
92 <tree string="Attendances" editable="bottom">
94 <field name="action"/>
95 <field invisible="1" name="employee_id"/>
100 <button name="sign_in" string="Sign In" type="object" icon="terp-gtk-jump-to-ltr"/>
101 <button name="sign_out" string="Sign Out" type="object" icon="terp-gtk-jump-to-rtl"/>
106 <field name="state_attendance"/>
108 <field colspan="4" context="{'date':date_current,'user_id':user_id}" domain="[('name','=',date_current)]" name="timesheet_ids" nolabel="1">
109 <tree editable="top" string="Timesheet Lines">
110 <field invisible="1" name="date"/>
111 <field domain="[('type','in',['normal', 'contract']), ('state', '<>', 'close'),('use_timesheets','=',1)]" name="account_id" on_change="on_change_account_id(account_id)" context="{'default_use_timesheets': 1}"/>
113 <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" widget="float_time"/>
114 <field name="to_invoice" widget="selection"/>
115 <field invisible="1" name="journal_id"/>
116 <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)"/>
117 <field invisible="1" name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)"/>
118 <field invisible="1" name="amount"/>
119 <field invisible="1" name="general_account_id"/>
120 <field invisible="1" name="user_id" required="1"/>
122 <form string="Timesheet Lines" version="7.0">
124 <field domain="[('type','=','normal'), ('state', '<>', 'close')]" name="account_id" on_change="on_change_account_id(account_id)"/>
126 <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" widget="float_time"/>
127 <field name="to_invoice"/>
128 <field name="journal_id"/>
129 <field name="product_id" domain="[('type','=','service')]" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)"/>
130 <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)"/>
131 <field name="amount"/>
132 <field name="general_account_id"/>
133 <field name="user_id" required="1" options='{"no_open": true}'/>
137 <page string="Summary">
138 <field colspan="4" name="period_ids" nolabel="1">
139 <tree colors="red:total_difference<0.1;blue:total_difference>=0.1" string="Period">
141 <field name="total_attendance" widget="float_time"/>
142 <field name="total_timesheet" widget="float_time"/>
143 <field name="total_difference" widget="float_time"/>
153 <record id="view_hr_timesheet_sheet_filter" model="ir.ui.view">
154 <field name="name">hr_timesheet_sheet.sheet.filter</field>
155 <field name="model">hr_timesheet_sheet.sheet</field>
156 <field name="type">search</field>
157 <field name="arch" type="xml">
158 <search string="Search Timesheet">
159 <field name="date_from"/>
160 <filter icon="terp-document-new" string="In Draft" domain="[('state','in',('draft', 'new'))]" help="Unvalidated Timesheets"/>
161 <filter icon="terp-camera_test" string="To Approve" domain="[('state','=','confirm')]" help="Confirmed Timesheets"/>
162 <field name="employee_id"/>
163 <field name="department_id"/>
164 <group expand="0" string="Group By...">
165 <filter string="Employees" icon="terp-personal" domain="[]" context="{'group_by':'employee_id'}"/>
166 <filter string="Department" icon="terp-personal+" domain="[]" context="{'group_by':'department_id'}"/>
172 <record id="act_hr_timesheet_sheet_form" model="ir.actions.act_window">
173 <field name="name">Timesheets</field>
174 <field name="type">ir.actions.act_window</field>
175 <field name="res_model">hr_timesheet_sheet.sheet</field>
176 <field name="view_type">form</field>
177 <field name="view_id" eval="False"/>
178 <field name="context">{'search_default_my_timesheet':1}</field>
179 <field name="search_view_id" ref="view_hr_timesheet_sheet_filter"/>
180 <field name="help" type="html">
181 <p class="oe_view_nocontent_create">
182 Click to go to your timesheet.
184 You must record timesheets every day and confirm at the end
185 of the week. Once the timesheet is confirmed, it his sent to
186 the manager for validation.
188 Timesheets can also be invoiced to customers, depending on the
189 configuration of the project.
194 <menuitem action="act_hr_timesheet_sheet_form" id="menu_act_hr_timesheet_sheet_form" parent="hr_attendance.menu_hr_time_tracking"
195 sequence="2" groups="base.group_hr_user,base.group_hr_manager"/>
201 <record id="hr_timesheet_sheet_company" model="ir.ui.view">
202 <field name="name">res.company.sheet</field>
203 <field name="model">res.company</field>
204 <field name="type">form</field>
205 <field name="inherit_id" ref="base.view_company_form"/>
206 <field name="arch" type="xml">
207 <xpath expr="//group[@name='account_grp']" position="after">
208 <group name="timesheets_grp" string="Timesheets">
209 <field name="timesheet_range"/>
210 <field name="timesheet_max_difference"/>
217 hr.analytic.timesheet inheritancy
220 <record id="hr_timesheet_line_form" model="ir.ui.view">
221 <field name="name">hr.analytic.timesheet.form</field>
222 <field name="model">hr.analytic.timesheet</field>
223 <field name="type">form</field>
224 <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/>
225 <field name="arch" type="xml">
226 <field name="date" position="after">
227 <field name="sheet_id" />
232 <record id="hr_timesheet_line_search" model="ir.ui.view">
233 <field name="name">hr.analytic.timesheet.search</field>
234 <field name="model">hr.analytic.timesheet</field>
235 <field name="type">form</field>
236 <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_search"/>
237 <field name="arch" type="xml">
238 <field name="date" position="before">
239 <field name="sheet_id"/>
245 hr.attendance inheritancy
248 <record model="ir.ui.view" id="view_hr_attendance_filter">
249 <field name="name">view_hr_attendance_filter</field>
250 <field name="model">hr.attendance</field>
251 <field name="type">search</field>
252 <field name="inherit_id" ref="hr_attendance.view_hr_attendance_filter" />
253 <field name="arch" type="xml">
254 <field name="employee_id" position="after">
255 <field name="sheet_id"/>
260 <record id="view_attendance_form" model="ir.ui.view">
261 <field name="name">hr.attendance.form</field>
262 <field name="model">hr.attendance</field>
263 <field name="type">form</field>
264 <field name="inherit_id" ref="hr_attendance.view_attendance_form"/>
265 <field name="arch" type="xml">
266 <field name="action_desc" position="after">
267 <field name="sheet_id"/>
271 <record id="view_attendance_tree" model="ir.ui.view">
272 <field name="name">hr.attendance.tree</field>
273 <field name="model">hr.attendance</field>
274 <field name="type">tree</field>
275 <field name="inherit_id" ref="hr_attendance.view_attendance_tree"/>
276 <field name="arch" type="xml">
277 <field name="action" position="after">
278 <field name="sheet_id"/>
282 <record id="view_attendance_tree_who" model="ir.ui.view">
283 <field name="name">hr.attendance.tree</field>
284 <field name="model">hr.attendance</field>
285 <field name="type">tree</field>
286 <field name="inherit_id" ref="hr_attendance.view_attendance_who"/>
287 <field name="arch" type="xml">
288 <field name="action" position="after">
289 <field name="sheet_id"/>
295 context="{'search_default_sheet_id': [active_id]}"
296 id="act_hr_timesheet_sheet_sheet_by_account"
297 name="Timesheet by Account"
298 res_model="hr_timesheet_sheet.sheet.account"
299 src_model="hr_timesheet_sheet.sheet"/>
302 context="{'search_default_sheet_id': [active_id]}"
303 id="act_hr_timesheet_sheet_sheet_by_day"
304 name="Timesheet by Day"
305 res_model="hr_timesheet_sheet.sheet.day"
306 src_model="hr_timesheet_sheet.sheet"/>
309 context="{'search_default_sheet_id': [active_id]}"
310 id="act_hr_timesheet_sheet_sheet_2_hr_analytic_timesheet"
311 name="Timesheet Lines"
312 res_model="hr.analytic.timesheet"
313 src_model="hr_timesheet_sheet.sheet"/>
317 context="{'search_default_sheet_id': [active_id]}"
318 id="act_hr_timesheet_sheet_sheet_2_hr_attendance"
320 res_model="hr.attendance"
321 src_model="hr_timesheet_sheet.sheet"/>
323 <record id="hr_timesheet_sheet_tree_simplified" model="ir.ui.view">
324 <field name="name">hr.timesheet.sheet.tree</field>
325 <field name="model">hr_timesheet_sheet.sheet</field>
326 <field name="type">tree</field>
327 <field eval="10" name="priority"/>
328 <field name="arch" type="xml">
329 <tree colors="blue:state == 'draft';black:state in ('confirm','new');gray:state == 'done'" string="Timesheets">
330 <field name="employee_id"/>
331 <field name="date_from"/>
332 <field name="date_to"/>
333 <field name="department_id"/>
334 <field name="total_attendance" widget="float_time"/>
335 <field name="total_timesheet" widget="float_time"/>
336 <field name="total_difference" widget="float_time"/>
337 <field name="state"/>
342 <record id="hr_timesheet_day_tree" model="ir.ui.view">
343 <field name="name">hr.timesheet.day.tree</field>
344 <field name="model">hr_timesheet_sheet.sheet.day</field>
345 <field name="type">tree</field>
346 <field name="arch" type="xml">
347 <tree colors="blue:total_difference<0.1;red:total_difference>=0.1" string="Period">
349 <field name="total_attendance" widget="float_time" sum="Total Attendances"/>
350 <field name="total_timesheet" widget="float_time" sum="Total Timesheet"/>
351 <field name="total_difference" widget="float_time" sum="Total Difference"/>
356 <!-- Timesheet Button on Employee Form -->
358 context="{'search_default_employee_id': [active_id], 'default_employee_id': active_id}"
359 id="act_hr_employee_2_hr_timesheet" name="Timesheets" res_model="hr_timesheet_sheet.sheet" src_model="hr.employee"/>
361 <record id="hr_timesheet_sheet_employee_extd_form" model="ir.ui.view">
362 <field name="name">hr.timesheet.sheet.employee.extd_form</field>
363 <field name="model">hr.employee</field>
364 <field name="inherit_id" ref="hr_timesheet.hr_timesheet_employee_extd_form"/>
365 <field name="arch" type="xml">
366 <xpath expr="//div[@name='button_box']" position="inside">
367 <button name="%(act_hr_employee_2_hr_timesheet)d" string="Timesheets" type="action"/>