Browse Source

Merge pull request #181 from acsone/8.0-mis.report.instance.copy-sbi

[IMP] mis_builder: copy semantics for mis.report.instance
pull/174/head
Stéphane Bidoul (ACSONE) 9 years ago
parent
commit
d67188a008
  1. 9
      mis_builder/models/mis_builder.py

9
mis_builder/models/mis_builder.py

@ -625,7 +625,8 @@ class MisReportInstance(models.Model):
period_ids = fields.One2many('mis.report.instance.period', period_ids = fields.One2many('mis.report.instance.period',
'report_instance_id', 'report_instance_id',
required=True, required=True,
string='Periods')
string='Periods',
copy=True)
target_move = fields.Selection([('posted', 'All Posted Entries'), target_move = fields.Selection([('posted', 'All Posted Entries'),
('all', 'All Entries')], ('all', 'All Entries')],
string='Target Moves', string='Target Moves',
@ -642,6 +643,12 @@ class MisReportInstance(models.Model):
required=True) required=True)
landscape_pdf = fields.Boolean(string='Landscape PDF') landscape_pdf = fields.Boolean(string='Landscape PDF')
@api.one
def copy(self, default=None):
default = dict(default or {})
default['name'] = _('%s (copy)') % self.name
return super(MisReportInstance, self).copy(default)
def _format_date(self, lang_id, date): def _format_date(self, lang_id, date):
# format date following user language # format date following user language
date_format = self.env['res.lang'].browse(lang_id).date_format date_format = self.env['res.lang'].browse(lang_id).date_format

Loading…
Cancel
Save