Skip to content

Commit

Permalink
[11.0][ADD] Feature: Last Week on hr_timesheet_attendance Report
Browse files Browse the repository at this point in the history
  • Loading branch information
HviorForgeFlow authored and LoisRForgeFlow committed Sep 16, 2019
1 parent 0489a5f commit 6ca0000
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions ao_hr_timesheet_sheet/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ This module contains customizations specific to Aleph Objects.
* A department manager can view/create/edit HR Timesheets of the employees
in her department
* Users cannot create projects from HR Timesheets
* Add Last Week filter on Timesheet Reporting

Credits
=======
Expand Down
4 changes: 3 additions & 1 deletion ao_hr_timesheet_sheet/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
"author": "Eficent Business and IT Consulting Services S.L.",
"website": "http://www.eficent.com",
"category": "Human Resources",
"depends": ["hr_timesheet_sheet"],
"depends": ["hr_timesheet_sheet",
"hr_timesheet_attendance"],
"license": "AGPL-3",
"data": [
"security/hr_timesheet_sheet_security.xml",
"views/account_analytic_line_view.xml",
"views/hr_timesheet_sheet_views.xml",
"views/hr_timesheet_attendance_report_view.xml"
],
"installable": True,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>

<record id="hr_timesheet_attendance_report_filter_last_week" model="ir.ui.view">
<field name="name">hr.timesheet.attendance.report.filter.last.week</field>
<field name="model">hr.timesheet.attendance.report</field>
<field name="inherit_id" ref="hr_timesheet_attendance.view_hr_timesheet_attendance_report_search"/>
<field name="arch" type="xml">
<xpath expr="//filter[@name='month']" position="after">
<filter name="last_week" string="Last Week"
domain="[
'&amp;',
('date', '>=', (context_today() + relativedelta(weeks=-2,days=1,weekday=0)).strftime('%Y-%m-%d')),
('date', '&lt;=', (context_today() + relativedelta(weeks=-1,weekday=6)).strftime('%Y-%m-%d')),
]"/>
</xpath>
</field>
</record>

</odoo>

0 comments on commit 6ca0000

Please sign in to comment.