Browse Source

[FIX] mis_builder: fix comparison_mode compute

pull/189/head
Stéphane Bidoul 9 years ago
parent
commit
e5b8932095
  1. 1
      mis_builder/README.rst
  2. 8
      mis_builder/models/mis_builder.py

1
mis_builder/README.rst

@ -109,6 +109,7 @@ Contributors
* Laetitia Gangloff <laetitia.gangloff@acsone.eu>
* Adrien Peiffer <adrien.peiffer@acsone.eu>
* Giovanni Capalbo <giovanni@therp.nl>
* Sébastien Beau <sebastien.beau@akretion.com>
Maintainer
----------

8
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):

Loading…
Cancel
Save