Skip to content

Commit

Permalink
[IMP] hr_attendance_report_theoretical_time: Add company compatibilit…
Browse files Browse the repository at this point in the history
…y in the report

If only one company is selected, only the data of the employees of that company should be displayed.

TT51401
  • Loading branch information
victoralmau committed Oct 29, 2024
1 parent c1af5ed commit fe619a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class HrAttendanceTheoreticalTimeReport(models.Model):
employee_id = fields.Many2one(
comodel_name="hr.employee", string="Employee", readonly=True
)
company_id = fields.Many2one(related="employee_id.company_id")
department_id = fields.Many2one(
comodel_name="hr.department",
string="Department",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<!-- Copyright 2018 Tecnativa - Pedro M. Baeza
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo noupdate="1">
<record id="rule_multi_company_theoretical_vs_worked_report" model="ir.rule">
<field name="name">Theoretical vs worked hours multi-company</field>
<field name="model_id" ref="model_hr_attendance_theoretical_time_report" />
<field name="domain_force">[('company_id', 'in', company_ids)]</field>
</record>
<record model="ir.rule" id="rule_theoretical_vs_worked_report_own">
<field name="name">Theoretical vs worked hours: Own attendances</field>
<field name="model_id" ref="model_hr_attendance_theoretical_time_report" />
Expand Down

0 comments on commit fe619a6

Please sign in to comment.