diff --git a/base_report_auto_create_qweb/models/report_xml.py b/base_report_auto_create_qweb/models/report_xml.py
index 866752b93..34408d711 100644
--- a/base_report_auto_create_qweb/models/report_xml.py
+++ b/base_report_auto_create_qweb/models/report_xml.py
@@ -61,15 +61,18 @@ class IrActionsReport(models.Model):
report_name = report.split('.')[1]
for report_view in self.env['ir.ui.view'].browse(report_view_ids):
origin_name = report_name.replace(('_%s' % suffix), '')
+ origin_module = module.replace(('_%s' % suffix), '')
new_report_name = '%s_%s' % (origin_name, suffix)
qweb_name = report_view.name.replace(
origin_name, new_report_name)
- arch = report_view.arch.replace(origin_name, new_report_name)
+ arch = report_view.arch.replace(
+ origin_name, new_report_name).replace(origin_module + '.',
+ module + '.')
report_xml._create_qweb(
name, qweb_name, module, model, arch)
if not report_view_ids:
arch = ('\n'
- '\n' % report)
+ '\n' % report_name)
report_xml._create_qweb(name, report_name, module, model, arch)
return report_xml
@@ -79,7 +82,10 @@ class IrActionsReport(models.Model):
default = {}
suffix = self.env.context.get('suffix', 'copy')
default['name'] = '%s (%s)' % (self.name, suffix)
- default['report_name'] = '%s_%s' % (self.report_name, suffix.lower())
+ module = '%s_%s' % (
+ self.report_name.split('.')[0], suffix.lower())
+ report = '%s_%s' % (self.report_name.split('.')[1], suffix.lower())
+ default['report_name'] = '%s.%s' % (module, report)
report_views = self.env['ir.ui.view'].search([
('name', 'ilike', self.report_name.split('.')[1]),
('type', '=', 'qweb')])