From e5b89320958a1fabc1efc1c4bb24de62b492d991 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Fri, 29 Apr 2016 10:37:05 +0200 Subject: [PATCH] [FIX] mis_builder: fix comparison_mode compute --- mis_builder/README.rst | 1 + mis_builder/models/mis_builder.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mis_builder/README.rst b/mis_builder/README.rst index d07593be..d6c8cb6e 100644 --- a/mis_builder/README.rst +++ b/mis_builder/README.rst @@ -109,6 +109,7 @@ Contributors * Laetitia Gangloff * Adrien Peiffer * Giovanni Capalbo +* Sébastien Beau Maintainer ---------- diff --git a/mis_builder/models/mis_builder.py b/mis_builder/models/mis_builder.py index 113cd7bc..8118f380 100644 --- a/mis_builder/models/mis_builder.py +++ b/mis_builder/models/mis_builder.py @@ -512,7 +512,7 @@ class MisReport(models.Model): res.update({ 'view_id': view.id, 'views': [(view.id, 'form')], - 'target':'new', + 'target': 'new', 'context': { 'default_report_id': self.id, 'default_name': self.name, @@ -805,7 +805,7 @@ class MisReportInstancePeriod(models.Model): mode = fields.Selection([('fix', 'Fix'), ('relative', 'Relative'), ], required=True, - default='fix') + default='fix') type = fields.Selection([('d', _('Day')), ('w', _('Week')), ('date_range', _('Date Range')) @@ -1074,7 +1074,7 @@ class MisReportInstance(models.Model): string='Date Range') date_from = fields.Date(string="From") date_to = fields.Date(string="To") - temporary = fields.Boolean() + temporary = fields.Boolean(default=False) @api.multi def save_report(self): @@ -1105,7 +1105,7 @@ class MisReportInstance(models.Model): @api.depends('date_from') def _compute_comparison_mode(self): for instance in self: - instance.advanced_mode = not bool(instance.date_from) + instance.comparison_mode = not bool(instance.date_from) @api.multi def _inverse_comparison_mode(self):