From 591d129924545a0d754a7d35582238dd6969a942 Mon Sep 17 00:00:00 2001 From: Carlos Lopez Date: Wed, 23 Oct 2024 07:58:01 -0500 Subject: [PATCH] [FIX] project_timeline: add fields in report.project.task.user to prevent errors on timeline view complementary to commit 42bd28c184729eaf07bd7eb399f36049cd31e2af --- project_timeline/__init__.py | 1 + project_timeline/report/__init__.py | 1 + project_timeline/report/project_report.py | 28 +++++++++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 project_timeline/report/__init__.py create mode 100644 project_timeline/report/project_report.py diff --git a/project_timeline/__init__.py b/project_timeline/__init__.py index 83e553ac46..4a509f6e6c 100644 --- a/project_timeline/__init__.py +++ b/project_timeline/__init__.py @@ -1,3 +1,4 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import models +from . import report diff --git a/project_timeline/report/__init__.py b/project_timeline/report/__init__.py new file mode 100644 index 0000000000..e56203fb75 --- /dev/null +++ b/project_timeline/report/__init__.py @@ -0,0 +1 @@ +from . import project_report diff --git a/project_timeline/report/project_report.py b/project_timeline/report/project_report.py new file mode 100644 index 0000000000..601d37b888 --- /dev/null +++ b/project_timeline/report/project_report.py @@ -0,0 +1,28 @@ +# Copyright 2024 Tecnativa - Carlos López +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class ReportProjectTaskUser(models.Model): + _inherit = "report.project.task.user" + + planned_date_start = fields.Datetime(readonly=True) + planned_date_end = fields.Datetime(readonly=True) + + def _select(self): + return ( + super()._select() + + """, + t.planned_date_start, + t.planned_date_end""" + ) + + def _group_by(self): + return ( + super()._group_by() + + """, + t.planned_date_start, + t.planned_date_end + """ + )