Skip to content

Commit

Permalink
[17.0][FIX] maintenance_timesheet: missing report
Browse files Browse the repository at this point in the history
  • Loading branch information
FernandoRomera committed Sep 13, 2024
1 parent 8d91a42 commit c0e6794
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions maintenance_timesheet/report/timesheets_analysis_report.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
from odoo import api, fields, models


class TimesheetsAnalysisReport(models.Model):
_inherit = "timesheets.analysis.report"

maintenance_request_id = fields.Many2one(comodel_name="maintenance.request", readonly=True)
maintenance_request_id = fields.Many2one(
comodel_name="maintenance.request", readonly=True
)

@property
def _table_query(self):
Expand All @@ -16,12 +19,18 @@ def _table_query(self):

@api.model
def _select(self):
return super()._select() + """,
return (
super()._select()
+ """,
A.maintenance_request_id AS maintenance_request_id
"""
)

@api.model
def _from(self):
return super()._from() + """
return (
super()._from()
+ """
LEFT JOIN maintenance_request MR ON A.maintenance_request_id = MR.id
"""
)

0 comments on commit c0e6794

Please sign in to comment.