Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMP] mis_builder: copy semantics for mis.report.instance #181

Merged
merged 1 commit into from
Apr 26, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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