| 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <odoo> |
| 3 | <data> |
| 4 | <record id="view_hr_timesheet_attendance_report_search" model="ir.ui.view"> |
| 5 | <field name="name">Search for HR timesheet attendance report</field> |
| 6 | <field name="model">hr.timesheet.attendance.report</field> |
| 7 | <field name="arch" type="xml"> |
| 8 | <search string="Timesheet Attendance"> |
| 9 | <field name="employee_id" string="Employee"/> |
| 10 | <filter string="My Team" name="my_team" domain="[('employee_id.parent_id.user_id', '=', uid)]"/> |
| 11 | <filter string="My Department" name="my_department" domain="[('employee_id.member_of_department', '=', True)]"/> |
| 12 | <separator/> |
| 13 | <filter name="month" string="Date" date="date"> |
| 14 | <filter name="date_this_week" string="This Week" domain="[ |
| 15 | ('date', '>=', '=week_start'), |
| 16 | ('date', '<', '=week_start +1w'), |
| 17 | ]"/> |
| 18 | <filter name="date_today" string="Today" domain="[('date', '>=', 'today'), ('date', '<', 'today +1d')]"/> |
| 19 | <filter name="date_last_week" string="Last Week" domain="[ |
| 20 | ('date', '>=', '=week_start -1w'), |
| 21 | ('date', '<', '=week_start'), |
| 22 | ]"/> |
| 23 | </filter> |
| 24 | <filter name="group_by_user" string="Employee" context="{'group_by': 'employee_id'}"/> |
| 25 | <filter name="group_by_month" string="Date" date="date" context="{'group_by': 'date'}"/> |
| 26 | </search> |
| 27 | </field> |
| 28 | </record> |
| 29 | <record id="view_hr_timesheet_attendance_report_pivot" model="ir.ui.view"> |
| 30 | <field name="name">HR timesheet attendance report: Pivot</field> |
| 31 | <field name="model">hr.timesheet.attendance.report</field> |
| 32 | <field name="arch" type="xml"> |
| 33 | <pivot string="Timesheet Attendance" disable_linking="1" sample="1"> |
| 34 | <field name="date" interval="month" type="row"/> |
| 35 | <field name="total_attendance" type="measure" widget="timesheet_uom"/> |
| 36 | <field name="total_timesheet" type="measure" widget="timesheet_uom"/> |
| 37 | <field name="total_difference" type="measure" widget="timesheet_uom"/> |
| 38 | <field name="timesheets_cost"/> |
| 39 | <field name="attendance_cost"/> |
| 40 | <field name="cost_difference"/> |
| 41 | </pivot> |
| 42 | </field> |
| 43 | </record> |
| 44 | |
| 45 | <record id="hr_timesheet_attendance_report_view_graph" model="ir.ui.view"> |
| 46 | <field name="name">hr.timesheet.attendance.report.view.graph</field> |
| 47 | <field name="model">hr.timesheet.attendance.report</field> |
| 48 | <field name="arch" type="xml"> |
| 49 | <graph string="Timesheet Attendance" sample="1" disable_linking="1"> |
| 50 | <field name="date" interval="month"/> |
| 51 | <field name="total_difference" type="measure" widget="timesheet_uom"/> |
| 52 | </graph> |
| 53 | </field> |
| 54 | </record> |
| 55 | |
| 56 | <record id="action_hr_timesheet_attendance_report" model="ir.actions.act_window"> |
| 57 | <field name="name">Timesheets / Attendance Analysis</field> |
| 58 | <field name="res_model">hr.timesheet.attendance.report</field> |
| 59 | <field name="path">timesheets-attendance-analysis</field> |
| 60 | <field name="view_mode">graph,pivot</field> |
| 61 | <field name="view_id" eval="False"/> |
| 62 | <field name="context">{}</field> |
| 63 | <field name="help" type="html"> |
| 64 | <p class="o_view_nocontent_empty_folder"> |
| 65 | No data yet! |
| 66 | </p><p> |
| 67 | Compare the time recorded by your employees with their attendance. |
| 68 | </p> |
| 69 | </field> |
| 70 | </record> |
| 71 | |
| 72 | <record id="action_hr_timesheet_attendance_report_pivot" model="ir.actions.act_window.view"> |
| 73 | <field name="sequence" eval="1"/> |
| 74 | <field name="view_mode">pivot</field> |
| 75 | <field name="view_id" ref="view_hr_timesheet_attendance_report_pivot"/> |
| 76 | <field name="act_window_id" ref="action_hr_timesheet_attendance_report"/> |
| 77 | </record> |
| 78 | |
| 79 | <record id="action_hr_timesheet_attendance_report_graph" model="ir.actions.act_window.view"> |
| 80 | <field name="view_mode">graph</field> |
| 81 | <field name="view_id" ref="hr_timesheet_attendance_report_view_graph"/> |
| 82 | <field name="act_window_id" ref="action_hr_timesheet_attendance_report"/> |
| 83 | </record> |
| 84 | |
| 85 | <menuitem id="menu_hr_timesheet_attendance_report" |
| 86 | parent="hr_timesheet.menu_timesheets_reports" |
| 87 | action="action_hr_timesheet_attendance_report" |
| 88 | name="Timesheets / Attendance Analysis"/> |
| 89 | </data> |
| 90 | </odoo> |