Skip to content

Commit

Permalink
[FIX] <base_report_auto_create_qweb> Fixing travis error
Browse files Browse the repository at this point in the history
  • Loading branch information
oihane authored and SimoRubi committed Mar 17, 2021
1 parent 89dbe55 commit 3e0a4fd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions base_report_auto_create_qweb/models/report_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ def create(self, values):
_("Template Name must contain at least a dot in it's name"))
report_xml = super(IrActionsReport, self).create(values)
if values.get('report_type') in ['qweb-pdf', 'qweb-html']:
report_views = self.env.context.get('report_views', False)
report_view_ids = self.env.context.get('report_views', False)
suffix = self.env.context.get('suffix', 'copy')
report_name = values['report_name']
module = report_name.split('.')[0]
name = report_name.split('.')[1]
for report_view in report_views:
for report_view in self.env['ir.ui.view'].browse(report_view_ids):
origin_name = name.replace(('_%s' % suffix), '')
new_report_name = '%s_%s' % (origin_name, suffix)
qweb_view_data = {
Expand Down Expand Up @@ -51,7 +51,7 @@ def create(self, values):
report_xml.id),
}
self.env['ir.values'].create(value_view_data)
if not report_views:
if not report_view_ids:
qweb_view_data = {
'name': name,
'mode': 'primary',
Expand Down Expand Up @@ -89,5 +89,5 @@ def copy(self, default=None):
('type', '=', 'qweb')])
return super(IrActionsReport,
self.with_context(
report_views=report_views,
report_views=report_views.ids,
suffix=suffix.lower())).copy(default=default)

0 comments on commit 3e0a4fd

Please sign in to comment.