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="arch" type="xml">
9 <form string="Timesheet by Accounts">
11 <field name="sheet_id"/>
12 <field name="name" groups="analytic.group_analytic_accounting"/>
13 <field name="total" sum="Total"/>
14 <field name="invoice_rate"/>
19 <record id="hr_timesheet_account_filter" model="ir.ui.view">
20 <field name="name">hr.timesheet.account.filter</field>
21 <field name="model">hr_timesheet_sheet.sheet.account</field>
22 <field name="arch" type="xml">
23 <search string="Search Account">
24 <field name="name" groups="analytic.group_analytic_accounting"/>
25 <field name="invoice_rate"/>
26 <field name="sheet_id" />
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="arch" type="xml">
34 <tree string="Timesheet by Accounts">
35 <field name="sheet_id"/>
36 <field name="name" groups="analytic.group_analytic_accounting"/>
37 <field name="total" sum="Total"/>
38 <field name="invoice_rate"/>
44 <record model="ir.actions.act_window" id="act_hr_timesheet_sheet_sheet_2_hr_analytic_timesheet">
45 <field name="context">{'search_default_sheet_id': [active_id]}</field>
46 <field name="name">Timesheet Activities</field>
47 <field name="res_model">hr.analytic.timesheet</field>
48 <field name="src_model">hr_timesheet_sheet.sheet</field>
52 <record model="ir.actions.act_window" id="act_hr_timesheet_sheet_sheet_2_hr_attendance">
53 <field name="context">{'search_default_sheet_id': [active_id]}</field>
54 <field name="name">Attendances</field>
55 <field name="res_model">hr.attendance</field>
56 <field name="src_model">hr_timesheet_sheet.sheet</field>
60 <record id="hr_timesheet_sheet_form" model="ir.ui.view">
61 <field name="name">hr.timesheet.sheet.form</field>
62 <field name="model">hr_timesheet_sheet.sheet</field>
63 <field name="arch" type="xml">
64 <form string="Timesheet">
66 <button name="button_confirm" states="draft" string="Submit to Manager" type="object" class="oe_highlight"/>
67 <button name="done" states="confirm" string="Approve" type="workflow" groups="base.group_hr_user" class="oe_highlight"/>
68 <button name="action_set_to_draft" states="done" string="Set to Draft" type="object" />
69 <button name="cancel" states="confirm" string="Refuse" type="workflow" groups="base.group_hr_user" />
70 <field name="state" widget="statusbar" statusbar_visible="new,confirm,done"/>
73 <div class="oe_right oe_button_box" name="buttons">
75 name="%(act_hr_timesheet_sheet_sheet_2_hr_analytic_timesheet)d"
76 class="oe_stat_button"
78 <field name="timesheet_activity_count" widget="statinfo" string="Timesheet" help="Timesheet Activities"/>
80 <button type="action" groups="base.group_hr_attendance"
81 class="oe_stat_button" icon="fa-users"
82 name="%(act_hr_timesheet_sheet_sheet_2_hr_attendance)d">
83 <field name="attendance_count" widget="statinfo" string="Attendances"/>
86 <div class="oe_title">
87 <label for="employee_id" class="oe_edit_only"/>
88 <h1><field name="employee_id" on_change="onchange_employee_id(employee_id)" class="oe_inline"/></h1>
89 <field name="user_id" invisible="1"/>
93 <label for="date_from" string="Timesheet Period"/>
94 <div><field name="date_from" class="oe_inline"/> to <field name="date_to" class="oe_inline"/></div>
95 <field name="name" invisible="1"/>
96 <field name="department_id" invisible="1"/>
97 <field name="company_id" groups="base.group_multi_company"/>
99 <group groups="base.group_hr_attendance">
100 <field name="total_attendance" widget="float_time"/>
101 <field name="total_timesheet" widget="float_time"/>
102 <field name="total_difference" widget="float_time"/>
106 <page string="Summary">
107 <widget type="weekly_timesheet" attrs="{'readonly': [['state', 'not in', ['new', 'draft']]]}">
110 <page string="Details">
111 <field context="{'employee_id': employee_id, 'user_id':user_id, 'timesheet_date_from': date_from, 'timesheet_date_to': date_to}" name="timesheet_ids" nolabel="1">
112 <tree editable="top" string="Timesheet Activities">
114 <field domain="[('type','in',['normal', 'contract']), ('state', '<>', 'close'),('use_timesheets','=',1)]" name="account_id" on_change="on_change_account_id(account_id, user_id)" context="{'default_use_timesheets': 1}"/>
116 <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" widget="float_time" string="Hours" sum="Hours"/>
117 <field name="to_invoice" widget="selection"/>
118 <field invisible="1" name="journal_id"/>
119 <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)"/>
120 <field invisible="1" name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)"/>
121 <field invisible="1" name="amount"/>
122 <field invisible="1" name="general_account_id"/>
123 <field invisible="1" name="user_id" required="1"/>
125 <form string="Timesheet Activities">
127 <field domain="[('type','=','normal'), ('state', '<>', 'close')]" name="account_id" on_change="on_change_account_id(account_id, user_id)"/>
129 <field name="unit_amount" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)" widget="float_time"/>
130 <field name="to_invoice"/>
131 <field name="journal_id"/>
132 <field name="product_id" domain="[('type','=','service')]" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)"/>
133 <field name="product_uom_id" on_change="on_change_unit_amount(product_id, unit_amount, False, product_uom_id,journal_id)"/>
134 <field name="amount"/>
135 <field name="general_account_id"/>
136 <field name="user_id" required="1"/>
140 <page string="Attendances" groups="base.group_hr_attendance">
142 <field context="{'employee_id': employee_id, 'user_id':user_id}" name="attendances_ids" nolabel="1">
143 <tree string="Attendances" editable="bottom">
145 <field name="action"/>
146 <field invisible="1" name="employee_id"/>
150 <label for="state_attendance"/>
152 <field name="state_attendance"/>
153 <button name="attendance_action_change" attrs="{'invisible': [('state_attendance', '=', 'present')]}" type="object" string="Sign In" class="oe_link"/>
154 <button name="attendance_action_change" attrs="{'invisible': ['|', ('state_attendance','=',False), ('state_attendance', '=', 'absent')]}" type="object" string="Sign Out" class="oe_link"/>
158 <field name="period_ids">
159 <tree colors="red:total_difference<0.1;blue:total_difference>=0.1" string="Period">
161 <field name="total_attendance" widget="float_time" sum="Attendances"/>
162 <field name="total_timesheet" widget="float_time" sum="Timesheets"/>
163 <field name="total_difference" widget="float_time" sum="Differences"/>
169 <div class="oe_chatter">
170 <field name="message_ids" widget="mail_thread"/>
171 <field name="message_follower_ids" widget="mail_followers"/>
177 <record id="view_hr_timesheet_sheet_filter" model="ir.ui.view">
178 <field name="name">hr_timesheet_sheet.sheet.filter</field>
179 <field name="model">hr_timesheet_sheet.sheet</field>
180 <field name="arch" type="xml">
181 <search string="Search Timesheet">
182 <field name="date_from"/>
183 <filter name="new" string="In Draft" domain="[('state','in',('draft', 'new'))]" help="Unvalidated Timesheets"/>
184 <filter name="to_approve" string="To Approve" domain="[('state','=','confirm')]" help="Confirmed Timesheets"/>
185 <field name="employee_id"/>
186 <field name="department_id"/>
187 <group expand="0" string="Group By">
188 <filter string="Employees" icon="terp-personal" domain="[]" context="{'group_by':'employee_id'}"/>
189 <filter string="Department" icon="terp-personal+" domain="[]" context="{'group_by':'department_id'}"/>
195 <record id="act_hr_timesheet_sheet_form" model="ir.actions.act_window">
196 <field name="name">Timesheets to Validate</field>
197 <field name="type">ir.actions.act_window</field>
198 <field name="res_model">hr_timesheet_sheet.sheet</field>
199 <field name="view_type">form</field>
200 <field name="view_id" eval="False"/>
201 <field name="context">{'search_default_to_approve':1}</field>
202 <field name="search_view_id" ref="view_hr_timesheet_sheet_filter"/>
203 <field name="help" type="html">
204 <p class="oe_view_nocontent_create">
205 New timesheet to approve.
207 You must record timesheets every day and confirm at the end
208 of the week. Once the timesheet is confirmed, it should be
209 validated by a manager.
211 Timesheets can also be invoiced to customers, depending on the
212 configuration of each project's related contract.
217 <menuitem action="act_hr_timesheet_sheet_form" id="menu_act_hr_timesheet_sheet_form" parent="hr_attendance.menu_hr_time_tracking"
218 sequence="2" groups="base.group_hr_user"/>
224 <record id="hr_timesheet_sheet_company" model="ir.ui.view">
225 <field name="name">res.company.sheet</field>
226 <field name="model">res.company</field>
227 <field name="inherit_id" ref="base.view_company_form"/>
228 <field name="arch" type="xml">
229 <xpath expr="//group[@name='account_grp']" position="after">
230 <group name="timesheets_grp" string="Timesheets">
231 <field name="timesheet_range"/>
232 <field name="timesheet_max_difference"/>
239 hr.analytic.timesheet inheritancy
242 <record id="hr_timesheet_line_form" model="ir.ui.view">
243 <field name="name">hr.analytic.timesheet.form</field>
244 <field name="model">hr.analytic.timesheet</field>
245 <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/>
246 <field name="arch" type="xml">
247 <field name="date" position="after">
248 <field name="sheet_id" />
253 <record id="hr_timesheet_line_search" model="ir.ui.view">
254 <field name="name">hr.analytic.timesheet.search</field>
255 <field name="model">hr.analytic.timesheet</field>
256 <field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_search"/>
257 <field name="arch" type="xml">
258 <field name="date" position="before">
259 <field name="sheet_id"/>
265 hr.attendance inheritancy
268 <record model="ir.ui.view" id="view_hr_attendance_filter">
269 <field name="name">view_hr_attendance_filter</field>
270 <field name="model">hr.attendance</field>
271 <field name="inherit_id" ref="hr_attendance.view_hr_attendance_filter" />
272 <field name="arch" type="xml">
273 <field name="employee_id" position="after">
274 <field name="sheet_id"/>
279 <record id="view_attendance_form" model="ir.ui.view">
280 <field name="name">hr.attendance.form</field>
281 <field name="model">hr.attendance</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"/>
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="inherit_id" ref="hr_attendance.view_attendance_tree"/>
293 <field name="arch" type="xml">
294 <field name="action" position="after">
295 <field name="sheet_id"/>
299 <record id="view_attendance_tree_who" model="ir.ui.view">
300 <field name="name">hr.attendance.tree</field>
301 <field name="model">hr.attendance</field>
302 <field name="inherit_id" ref="hr_attendance.view_attendance_who"/>
303 <field name="arch" type="xml">
304 <field name="action" position="after">
305 <field name="sheet_id"/>
311 context="{'search_default_sheet_id': [active_id]}"
312 id="act_hr_timesheet_sheet_sheet_by_account"
313 name="Timesheet by Account"
314 groups="base.group_hr_attendance"
315 res_model="hr_timesheet_sheet.sheet.account"
316 src_model="hr_timesheet_sheet.sheet"/>
319 context="{'search_default_sheet_id': [active_id]}"
320 id="act_hr_timesheet_sheet_sheet_by_day"
321 name="Timesheet by Day"
322 groups="base.group_hr_attendance"
323 res_model="hr_timesheet_sheet.sheet.day"
324 src_model="hr_timesheet_sheet.sheet"/>
326 <record id="hr_timesheet_sheet_tree_simplified" model="ir.ui.view">
327 <field name="name">hr.timesheet.sheet.tree</field>
328 <field name="model">hr_timesheet_sheet.sheet</field>
329 <field eval="10" name="priority"/>
330 <field name="arch" type="xml">
331 <tree colors="blue:state == 'draft';black:state in ('confirm','new');gray:state == 'done'" string="Timesheets">
332 <field name="employee_id"/>
333 <field name="date_from"/>
334 <field name="date_to"/>
335 <field name="department_id" invisible="1"/>
336 <field name="total_attendance" widget="float_time" groups="base.group_hr_attendance"/>
337 <field name="total_timesheet" widget="float_time"/>
338 <field name="total_difference" widget="float_time" groups="base.group_hr_attendance"/>
339 <field name="state"/>
344 <record id="hr_timesheet_day_tree" model="ir.ui.view">
345 <field name="name">hr.timesheet.day.tree</field>
346 <field name="model">hr_timesheet_sheet.sheet.day</field>
347 <field name="arch" type="xml">
348 <tree colors="blue:total_difference<0.1;red:total_difference>=0.1" string="Period">
350 <field name="total_attendance" widget="float_time" sum="Total Attendances" groups="base.group_hr_attendance"/>
351 <field name="total_timesheet" widget="float_time" sum="Total Timesheet"/>
352 <field name="total_difference" widget="float_time" sum="Total Difference" groups="base.group_hr_attendance"/>
357 <!-- Timesheet Button on Employee Form -->
359 <record id="act_hr_employee_2_hr_timesheet" model="ir.actions.act_window">
360 <field name="res_model">hr_timesheet_sheet.sheet</field>
361 <field name="view_type">form</field>
362 <field name="name">Timesheets</field>
363 <field name="view_mode">tree,form</field>
364 <field name="context">{'search_default_employee_id': [active_id], 'default_employee_id': active_id}</field>
367 <record id="hr_timesheet_sheet_employee_extd_form" model="ir.ui.view">
368 <field name="name">hr.timesheet.sheet.employee.extd_form</field>
369 <field name="model">hr.employee</field>
370 <field name="inherit_id" ref="hr_timesheet.hr_timesheet_employee_extd_form"/>
371 <field name="arch" type="xml">
372 <xpath expr="//div[@name='button_box']" position="inside">
373 <button name="%(act_hr_employee_2_hr_timesheet)d"
375 class="oe_stat_button"
377 groups="base.group_hr_manager">
378 <field name="timesheet_count" widget="statinfo" string="Timesheets"/>