[FIX] hr_attendance: set default filter for reporting

If you have a lot of attendance spread accross various employees and various dates,
the report takes ages to load (or your browser freezes and you can't access reporting).

And if it loads, the report is unreadable anyway. Use a default filter to always
display user friendly graphs. Since we group by day, a default period of a month seems
like a good compromise.

To reproduce the issue:
- install hr_attendance
- use a script to create some attendances (ex: create 300 employees and 30
attendance for each, spread randomly in the last 3 years)
- click on "Reporting"

opw-3167099

closes odoo/odoo#112879

X-original-commit: 59bf5d4c5e7c95c6f561140f71634d84a12568a0
Signed-off-by: Kevin Baptiste <kba@odoo.com>
This commit is contained in:
nda-odoo
2023-02-16 16:58:43 +01:00
parent 577eb578b0
commit c55f39b5b1
@@ -7,7 +7,7 @@
<search string="HR Attendance Search">
<field name="employee_id"/>
<field name="department_id" operator="child_of"/>
<filter name="check_in" string="Check In" date="check_in"/>
<filter name="check_in" string="Check In" date="check_in" default_period="last_month"/>
<group expand="0" string="Group By">
<filter string="Employee" name="groupby_employee" context="{'group_by': 'employee_id'}"/>
<filter string="Check In" name="groupby_check_in" context="{'group_by': 'check_in'}"/>
@@ -47,7 +47,7 @@
<field name="res_model">hr.attendance.report</field>
<field name="view_mode">graph,pivot</field>
<field name="search_view_id" ref="hr_attendance_report_view_search"/>
<field name="context">{'group_by': ['check_in:day', 'employee_id']}</field>
<field name="context">{'group_by': ['check_in:day', 'employee_id'], 'search_default_check_in': '1'}</field>
</record>
<record id="hr_attendance_report_action_filtered" model="ir.actions.act_window">