From dd52a844a64b3da5d1589796bf8bb063efb5cc26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Sun, 8 May 2016 13:19:55 +0200 Subject: [PATCH] [FIX] mis_builder: fix period comment (date from/to) display --- mis_builder/models/mis_builder.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mis_builder/models/mis_builder.py b/mis_builder/models/mis_builder.py index c79d16fc..2ae17ba6 100644 --- a/mis_builder/models/mis_builder.py +++ b/mis_builder/models/mis_builder.py @@ -850,8 +850,9 @@ class MisReportInstancePeriod(models.Model): """ @api.one - @api.depends('report_instance_id.pivot_date', 'type', 'offset', - 'duration', 'report_instance_id.comparison_mode') + @api.depends('report_instance_id.pivot_date', + 'report_instance_id.comparison_mode', + 'type', 'offset', 'duration', 'mode') def _compute_dates(self): self.date_from = False self.date_to = False @@ -1315,7 +1316,7 @@ class MisReportInstance(models.Model): kpi_matrix = self.report_id._prepare_kpi_matrix() for period in self.period_ids: # add the column header - if period.duration == 1 and period.type == 'd': + if period.date_from == period.date_to: comment = self._format_date(period.date_from) else: # from, to @@ -1335,6 +1336,7 @@ class MisReportInstance(models.Model): period.subkpi_ids, period._get_additional_move_line_filter, period._get_additional_query_filter) + # TODO FIXME comparison columns header = [{'cols': []}, {'cols': []}] for col in kpi_matrix.iter_cols():