Skip to content

Commit

Permalink
Merge pull request #181 from acsone/8.0-mis.report.instance.copy-sbi
Browse files Browse the repository at this point in the history
[IMP] mis_builder: copy semantics for mis.report.instance
  • Loading branch information
sbidoul committed Apr 26, 2016
2 parents 459232d + ec69091 commit d67188a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion mis_builder/models/mis_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,8 @@ def _compute_pivot_date(self):
period_ids = fields.One2many('mis.report.instance.period',
'report_instance_id',
required=True,
string='Periods')
string='Periods',
copy=True)
target_move = fields.Selection([('posted', 'All Posted Entries'),
('all', 'All Entries')],
string='Target Moves',
Expand All @@ -642,6 +643,12 @@ def _compute_pivot_date(self):
required=True)
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):
# format date following user language
date_format = self.env['res.lang'].browse(lang_id).date_format
Expand Down

0 comments on commit d67188a

Please sign in to comment.