flectra/addons/hr_timesheet_attendance/report/hr_timesheet_attendance_report_view.xml
2018-01-16 02:34:37 -08:00

52 lines
2.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<flectra>
<data>
<record id="view_hr_timesheet_attendance_report_search" model="ir.ui.view">
<field name="name">Search for HR timesheet attendance report</field>
<field name="model">hr.timesheet.attendance.report</field>
<field name="arch" type="xml">
<search string="timesheet attendance">
<field name="user_id"/>
<filter name="week" string="This Week"
domain="[
'&amp;',
('date', '>=', (context_today() + relativedelta(weeks=-1,days=1,weekday=0)).strftime('%Y-%m-%d')),
('date', '&lt;=', (context_today() + relativedelta(weekday=6)).strftime('%Y-%m-%d')),
]"/>
<filter name="month" string="This Month"
domain="[
'&amp;',
('date', '>=', (context_today() + relativedelta(day=1)).strftime('%Y-%m-%d')),
('date', '&lt;=', (context_today() + relativedelta(months=1, day=1, days=-1)).strftime('%Y-%m-%d')),
]"/>
</search>
</field>
</record>
<record id="view_hr_timesheet_attendance_report_pivot" model="ir.ui.view">
<field name="name">HR timesheet attendance report: Pivot</field>
<field name="model">hr.timesheet.attendance.report</field>
<field name="arch" type="xml">
<pivot string="timesheet attendance">
<field name="user_id" type="row"/>
<field name="date" interval="day" type="col"/>
<field name="total_difference" type="measure" widget="float_time"/>
<field name="total_timesheet" type="measure" widget="float_time"/>
<field name="total_attendance" type="measure" widget="float_time"/>
</pivot>
</field>
</record>
<record id="action_hr_timesheet_attendance_report" model="ir.actions.act_window">
<field name="name">HR Timesheet/Attendance Report</field>
<field name="res_model">hr.timesheet.attendance.report</field>
<field name="view_mode">pivot</field>
<field name="context">{'search_default_week': True}</field>
</record>
<menuitem id="menu_hr_timesheet_attendance_report"
parent="hr_timesheet.menu_timesheets_reports"
action="action_hr_timesheet_attendance_report"
name="Timesheet / Attendance"/>
</data>
</flectra>