prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  [8.0] base_report_auto_create_qweb - it does not create qweb views
  Tested on runbot.
  
  When creating a new report it seems that it does not create the views. So you can not configure a new one.
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `base_report_auto_create_qweb/models/report_xml.py`
  Content:
  ```
  1 # -*- encoding: utf-8 -*-
  2 ##############################################################################
  3 # For copyright and license notices, see __openerp__.py file in root directory
  4 ##############################################################################
  5 
  6 from openerp import models, api, exceptions, _
  7 
  8 
  9 class IrActionsReport(models.Model):
  10     _inherit = 'ir.actions.report.xml'
  11 
  12     def _prepare_qweb_view_data(self, qweb_name, arch):
  13         return {
  14             'name': qweb_name,
  15             'mode': 'primary',
  16             'type': 'qweb',
  17             'arch': arch,
  18         }
  19 
  20     def _prepare_model_data_data(self, qweb_name, module, qweb_view):
  21         return {
  22             'module': module,
  23             'name': qweb_name,
  24             'res_id': qweb_view.id,
  25             'model': 'ir.ui.view',
  26         }
  27 
  28     def _prepare_value_view_data(self, name, model):
  29         return {
  30             'name': name,
  31             'model': model,
  32             'key2': 'client_print_multi',
  33             'value_unpickle': 'ir.actions.report.xml,%s' % self.id,
  34         }
  35 
  36     def _create_qweb(self, name, qweb_name, module, model, arch):
  37         qweb_view_data = self._prepare_qweb_view_data(qweb_name, arch)
  38         qweb_view = self.env['ir.ui.view'].create(qweb_view_data)
  39         model_data_data = self._prepare_model_data_data(
  40             qweb_name, module, qweb_view)
  41         self.env['ir.model.data'].create(model_data_data)
  42         value_view_data = self._prepare_value_view_data(
  43             name, model)
  44         self.env['ir.values'].sudo().create(value_view_data)
  45 
  46     @api.model
  47     def create(self, values):
  48         if not self.env.context.get('enable_duplication', False):
  49             return super(IrActionsReport, self).create(values)
  50         if (values.get('report_type') in ['qweb-pdf', 'qweb-html'] and
  51                 values.get('report_name') and
  52                 values['report_name'].find('.') == -1):
  53             raise exceptions.Warning(
  54                 _("Template Name must contain at least a dot in it's name"))
  55         report_xml = super(IrActionsReport, self).create(values)
  56         if values.get('report_type') in ['qweb-pdf', 'qweb-html']:
  57             report_view_ids = self.env.context.get('report_views', False)
  58             suffix = self.env.context.get('suffix', 'copy')
  59             name = values['name']
  60             model = values['model']
  61             report = values['report_name']
  62             module = report.split('.')[0]
  63             report_name = report.split('.')[1]
  64             for report_view in self.env['ir.ui.view'].browse(report_view_ids):
  65                 origin_name = report_name.replace(('_%s' % suffix), '')
  66                 origin_module = module.replace(('_%s' % suffix), '')
  67                 new_report_name = '%s_%s' % (origin_name, suffix)
  68                 qweb_name = report_view.name.replace(
  69                     origin_name, new_report_name)
  70                 arch = report_view.arch.replace(
  71                     origin_name, new_report_name).replace(origin_module + '.',
  72                                                           module + '.')
  73                 report_xml._create_qweb(
  74                     name, qweb_name, module, model, arch)
  75             if not report_view_ids:
  76                 arch = ('<?xml version="1.0"?>\n'
  77                         '<t t-name="%s">\n</t>' % report_name)
  78                 report_xml._create_qweb(name, report_name, module, model, arch)
  79         return report_xml
  80 
  81     @api.one
  82     def copy(self, default=None):
  83         if not self.env.context.get('enable_duplication', False):
  84             return super(IrActionsReport, self).copy(default=default)
  85         if default is None:
  86             default = {}
  87         suffix = self.env.context.get('suffix', 'copy')
  88         default['name'] = '%s (%s)' % (self.name, suffix)
  89         module = '%s_%s' % (
  90             self.report_name.split('.')[0], suffix.lower())
  91         report = '%s_%s' % (self.report_name.split('.')[1], suffix.lower())
  92         default['report_name'] = '%s.%s' % (module, report)
  93         report_views = self.env['ir.ui.view'].search([
  94             ('name', 'ilike', self.report_name.split('.')[1]),
  95             ('type', '=', 'qweb')])
  96         return super(IrActionsReport,
  97                      self.with_context(
  98                          report_views=report_views.ids,
  99                          suffix=suffix.lower())).copy(default=default)
  100
  ```
  
  Path: `base_report_auto_create_qweb/__openerp__.py`
  Content:
  ```
  1 # -*- encoding: utf-8 -*-
  2 ##############################################################################
  3 #
  4 #    This program is free software: you can redistribute it and/or modify
  5 #    it under the terms of the GNU Affero General Public License as published
  6 #    by the Free Software Foundation, either version 3 of the License, or
  7 #    (at your option) any later version.
  8 #
  9 #    This program is distributed in the hope that it will be useful,
  10 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12 #    GNU General Public License for more details.
  13 #
  14 #    You should have received a copy of the GNU Affero General Public License
  15 #    along with this program.  If not, see http://www.gnu.org/licenses/.
  16 #
  17 ##############################################################################
  18 
  19 {
  20     "name": "Report qweb auto generation",
  21     "version": "1.0",
  22     "depends": [
  23         "report",
  24     ],
  25     "author": "OdooMRP team, "
  26               "AvanzOSC, "
  27               "Serv. Tecnol. Avanzados - Pedro M. Baeza, "
  28               "Odoo Community Association (OCA), ",
  29     "website": "http://www.odoomrp.com",
  30     'license': 'AGPL-3',
  31     "contributors": [
  32         "Oihane Crucelaegui <oihanecrucelaegi@avanzosc.es>",
  33         "Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>",
  34         "Ana Juaristi <anajuaristi@avanzosc.es>",
  35     ],
  36     "category": "Tools",
  37     "data": [
  38         "wizard/report_duplicate_view.xml",
  39         "views/report_xml_view.xml",
  40     ],
  41     "installable": True,
  42 }
  43
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/base_report_auto_create_qweb/__openerp__.py b/base_report_auto_create_qweb/__openerp__.py
  --- a/base_report_auto_create_qweb/__openerp__.py
  +++ b/base_report_auto_create_qweb/__openerp__.py
  @@ -22,12 +22,17 @@
       "depends": [
           "report",
       ],
  +    "external_dependencies": {
  +        "python": [
  +            "unidecode",
  +        ],
  +    },
       "author": "OdooMRP team, "
                 "AvanzOSC, "
                 "Serv. Tecnol. Avanzados - Pedro M. Baeza, "
                 "Odoo Community Association (OCA), ",
       "website": "http://www.odoomrp.com",
  -    'license': 'AGPL-3',
  +    "license": "AGPL-3",
       "contributors": [
           "Oihane Crucelaegui <oihanecrucelaegi@avanzosc.es>",
           "Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>",
  diff --git a/base_report_auto_create_qweb/models/report_xml.py b/base_report_auto_create_qweb/models/report_xml.py
  --- a/base_report_auto_create_qweb/models/report_xml.py
  +++ b/base_report_auto_create_qweb/models/report_xml.py
  @@ -4,11 +4,23 @@
   ##############################################################################
   
   from openerp import models, api, exceptions, _
  +import logging
  +
  +_logger = logging.getLogger(__name__)
   
   
   class IrActionsReport(models.Model):
       _inherit = 'ir.actions.report.xml'
   
  +    def _format_template_name(self, text):
  +        try:
  +            from unidecode import unidecode
  +        except ImportError:
  +            _logger.debug('Can not `import unidecode`.')
  +        text = unidecode(unicode(text))
  +        text.lower()
  +        return text.encode('iso-8859-1')
  +
       def _prepare_qweb_view_data(self, qweb_name, arch):
           return {
               'name': qweb_name,
  @@ -45,17 +57,19 @@
   
       @api.model
       def create(self, values):
  -        if not self.env.context.get('enable_duplication', False):
  -            return super(IrActionsReport, self).create(values)
  +        values['report_name'] = self._format_template_name(
  +            values.get('report_name', ''))
           if (values.get('report_type') in ['qweb-pdf', 'qweb-html'] and
                   values.get('report_name') and
                   values['report_name'].find('.') == -1):
               raise exceptions.Warning(
                   _("Template Name must contain at least a dot in it's name"))
  +        if not self.env.context.get('enable_duplication', False):
  +            return super(IrActionsReport, self).create(values)
           report_xml = super(IrActionsReport, self).create(values)
           if values.get('report_type') in ['qweb-pdf', 'qweb-html']:
               report_view_ids = self.env.context.get('report_views', False)
  -            suffix = self.env.context.get('suffix', 'copy')
  +            suffix = self.env.context.get('suffix') or 'copy'
               name = values['name']
               model = values['model']
               report = values['report_name']
  @@ -84,7 +98,7 @@
               return super(IrActionsReport, self).copy(default=default)
           if default is None:
               default = {}
  -        suffix = self.env.context.get('suffix', 'copy')
  +        suffix = self.env.context.get('suffix') or 'copy'
           default['name'] = '%s (%s)' % (self.name, suffix)
           module = '%s_%s' % (
               self.report_name.split('.')[0], suffix.lower())
  @@ -97,3 +111,13 @@
                        self.with_context(
                            report_views=report_views.ids,
                            suffix=suffix.lower())).copy(default=default)
  +
  +    @api.multi
  +    def button_create_qweb(self):
  +        self.ensure_one()
  +        module = self.report_name.split('.')[0]
  +        report_name = self.report_name.split('.')[1]
  +        arch = ('<?xml version="1.0"?>\n'
  +                '<t t-name="%s">\n</t>' % self.report_name)
  +        self._create_qweb(self.name, report_name, module, self.model, arch)
  +        self.associated_view()
  
verification_info: {"golden_diff": "diff --git a/base_report_auto_create_qweb/__openerp__.py b/base_report_auto_create_qweb/__openerp__.py\n--- a/base_report_auto_create_qweb/__openerp__.py\n+++ b/base_report_auto_create_qweb/__openerp__.py\n@@ -22,12 +22,17 @@\n     \"depends\": [\n         \"report\",\n     ],\n+    \"external_dependencies\": {\n+        \"python\": [\n+            \"unidecode\",\n+        ],\n+    },\n     \"author\": \"OdooMRP team, \"\n               \"AvanzOSC, \"\n               \"Serv. Tecnol. Avanzados - Pedro M. Baeza, \"\n               \"Odoo Community Association (OCA), \",\n     \"website\": \"http://www.odoomrp.com\",\n-    'license': 'AGPL-3',\n+    \"license\": \"AGPL-3\",\n     \"contributors\": [\n         \"Oihane Crucelaegui <oihanecrucelaegi@avanzosc.es>\",\n         \"Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>\",\ndiff --git a/base_report_auto_create_qweb/models/report_xml.py b/base_report_auto_create_qweb/models/report_xml.py\n--- a/base_report_auto_create_qweb/models/report_xml.py\n+++ b/base_report_auto_create_qweb/models/report_xml.py\n@@ -4,11 +4,23 @@\n ##############################################################################\n \n from openerp import models, api, exceptions, _\n+import logging\n+\n+_logger = logging.getLogger(__name__)\n \n \n class IrActionsReport(models.Model):\n     _inherit = 'ir.actions.report.xml'\n \n+    def _format_template_name(self, text):\n+        try:\n+            from unidecode import unidecode\n+        except ImportError:\n+            _logger.debug('Can not `import unidecode`.')\n+        text = unidecode(unicode(text))\n+        text.lower()\n+        return text.encode('iso-8859-1')\n+\n     def _prepare_qweb_view_data(self, qweb_name, arch):\n         return {\n             'name': qweb_name,\n@@ -45,17 +57,19 @@\n \n     @api.model\n     def create(self, values):\n-        if not self.env.context.get('enable_duplication', False):\n-            return super(IrActionsReport, self).create(values)\n+        values['report_name'] = self._format_template_name(\n+            values.get('report_name', ''))\n         if (values.get('report_type') in ['qweb-pdf', 'qweb-html'] and\n                 values.get('report_name') and\n                 values['report_name'].find('.') == -1):\n             raise exceptions.Warning(\n                 _(\"Template Name must contain at least a dot in it's name\"))\n+        if not self.env.context.get('enable_duplication', False):\n+            return super(IrActionsReport, self).create(values)\n         report_xml = super(IrActionsReport, self).create(values)\n         if values.get('report_type') in ['qweb-pdf', 'qweb-html']:\n             report_view_ids = self.env.context.get('report_views', False)\n-            suffix = self.env.context.get('suffix', 'copy')\n+            suffix = self.env.context.get('suffix') or 'copy'\n             name = values['name']\n             model = values['model']\n             report = values['report_name']\n@@ -84,7 +98,7 @@\n             return super(IrActionsReport, self).copy(default=default)\n         if default is None:\n             default = {}\n-        suffix = self.env.context.get('suffix', 'copy')\n+        suffix = self.env.context.get('suffix') or 'copy'\n         default['name'] = '%s (%s)' % (self.name, suffix)\n         module = '%s_%s' % (\n             self.report_name.split('.')[0], suffix.lower())\n@@ -97,3 +111,13 @@\n                      self.with_context(\n                          report_views=report_views.ids,\n                          suffix=suffix.lower())).copy(default=default)\n+\n+    @api.multi\n+    def button_create_qweb(self):\n+        self.ensure_one()\n+        module = self.report_name.split('.')[0]\n+        report_name = self.report_name.split('.')[1]\n+        arch = ('<?xml version=\"1.0\"?>\\n'\n+                '<t t-name=\"%s\">\\n</t>' % self.report_name)\n+        self._create_qweb(self.name, report_name, module, self.model, arch)\n+        self.associated_view()\n", "issue": "[8.0] base_report_auto_create_qweb - it does not create qweb views\nTested on runbot.\n\nWhen creating a new report it seems that it does not create the views. So you can not configure a new one.\n\n", "before_files": [{"content": "# -*- encoding: utf-8 -*-\n##############################################################################\n# For copyright and license notices, see __openerp__.py file in root directory\n##############################################################################\n\nfrom openerp import models, api, exceptions, _\n\n\nclass IrActionsReport(models.Model):\n    _inherit = 'ir.actions.report.xml'\n\n    def _prepare_qweb_view_data(self, qweb_name, arch):\n        return {\n            'name': qweb_name,\n            'mode': 'primary',\n            'type': 'qweb',\n            'arch': arch,\n        }\n\n    def _prepare_model_data_data(self, qweb_name, module, qweb_view):\n        return {\n            'module': module,\n            'name': qweb_name,\n            'res_id': qweb_view.id,\n            'model': 'ir.ui.view',\n        }\n\n    def _prepare_value_view_data(self, name, model):\n        return {\n            'name': name,\n            'model': model,\n            'key2': 'client_print_multi',\n            'value_unpickle': 'ir.actions.report.xml,%s' % self.id,\n        }\n\n    def _create_qweb(self, name, qweb_name, module, model, arch):\n        qweb_view_data = self._prepare_qweb_view_data(qweb_name, arch)\n        qweb_view = self.env['ir.ui.view'].create(qweb_view_data)\n        model_data_data = self._prepare_model_data_data(\n            qweb_name, module, qweb_view)\n        self.env['ir.model.data'].create(model_data_data)\n        value_view_data = self._prepare_value_view_data(\n            name, model)\n        self.env['ir.values'].sudo().create(value_view_data)\n\n    @api.model\n    def create(self, values):\n        if not self.env.context.get('enable_duplication', False):\n            return super(IrActionsReport, self).create(values)\n        if (values.get('report_type') in ['qweb-pdf', 'qweb-html'] and\n                values.get('report_name') and\n                values['report_name'].find('.') == -1):\n            raise exceptions.Warning(\n                _(\"Template Name must contain at least a dot in it's name\"))\n        report_xml = super(IrActionsReport, self).create(values)\n        if values.get('report_type') in ['qweb-pdf', 'qweb-html']:\n            report_view_ids = self.env.context.get('report_views', False)\n            suffix = self.env.context.get('suffix', 'copy')\n            name = values['name']\n            model = values['model']\n            report = values['report_name']\n            module = report.split('.')[0]\n            report_name = report.split('.')[1]\n            for report_view in self.env['ir.ui.view'].browse(report_view_ids):\n                origin_name = report_name.replace(('_%s' % suffix), '')\n                origin_module = module.replace(('_%s' % suffix), '')\n                new_report_name = '%s_%s' % (origin_name, suffix)\n                qweb_name = report_view.name.replace(\n                    origin_name, new_report_name)\n                arch = report_view.arch.replace(\n                    origin_name, new_report_name).replace(origin_module + '.',\n                                                          module + '.')\n                report_xml._create_qweb(\n                    name, qweb_name, module, model, arch)\n            if not report_view_ids:\n                arch = ('<?xml version=\"1.0\"?>\\n'\n                        '<t t-name=\"%s\">\\n</t>' % report_name)\n                report_xml._create_qweb(name, report_name, module, model, arch)\n        return report_xml\n\n    @api.one\n    def copy(self, default=None):\n        if not self.env.context.get('enable_duplication', False):\n            return super(IrActionsReport, self).copy(default=default)\n        if default is None:\n            default = {}\n        suffix = self.env.context.get('suffix', 'copy')\n        default['name'] = '%s (%s)' % (self.name, suffix)\n        module = '%s_%s' % (\n            self.report_name.split('.')[0], suffix.lower())\n        report = '%s_%s' % (self.report_name.split('.')[1], suffix.lower())\n        default['report_name'] = '%s.%s' % (module, report)\n        report_views = self.env['ir.ui.view'].search([\n            ('name', 'ilike', self.report_name.split('.')[1]),\n            ('type', '=', 'qweb')])\n        return super(IrActionsReport,\n                     self.with_context(\n                         report_views=report_views.ids,\n                         suffix=suffix.lower())).copy(default=default)\n", "path": "base_report_auto_create_qweb/models/report_xml.py"}, {"content": "# -*- encoding: utf-8 -*-\n##############################################################################\n#\n#    This program is free software: you can redistribute it and/or modify\n#    it under the terms of the GNU Affero General Public License as published\n#    by the Free Software Foundation, either version 3 of the License, or\n#    (at your option) any later version.\n#\n#    This program is distributed in the hope that it will be useful,\n#    but WITHOUT ANY WARRANTY; without even the implied warranty of\n#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n#    GNU General Public License for more details.\n#\n#    You should have received a copy of the GNU Affero General Public License\n#    along with this program.  If not, see http://www.gnu.org/licenses/.\n#\n##############################################################################\n\n{\n    \"name\": \"Report qweb auto generation\",\n    \"version\": \"1.0\",\n    \"depends\": [\n        \"report\",\n    ],\n    \"author\": \"OdooMRP team, \"\n              \"AvanzOSC, \"\n              \"Serv. Tecnol. Avanzados - Pedro M. Baeza, \"\n              \"Odoo Community Association (OCA), \",\n    \"website\": \"http://www.odoomrp.com\",\n    'license': 'AGPL-3',\n    \"contributors\": [\n        \"Oihane Crucelaegui <oihanecrucelaegi@avanzosc.es>\",\n        \"Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>\",\n        \"Ana Juaristi <anajuaristi@avanzosc.es>\",\n    ],\n    \"category\": \"Tools\",\n    \"data\": [\n        \"wizard/report_duplicate_view.xml\",\n        \"views/report_xml_view.xml\",\n    ],\n    \"installable\": True,\n}\n", "path": "base_report_auto_create_qweb/__openerp__.py"}], "after_files": [{"content": "# -*- encoding: utf-8 -*-\n##############################################################################\n# For copyright and license notices, see __openerp__.py file in root directory\n##############################################################################\n\nfrom openerp import models, api, exceptions, _\nimport logging\n\n_logger = logging.getLogger(__name__)\n\n\nclass IrActionsReport(models.Model):\n    _inherit = 'ir.actions.report.xml'\n\n    def _format_template_name(self, text):\n        try:\n            from unidecode import unidecode\n        except ImportError:\n            _logger.debug('Can not `import unidecode`.')\n        text = unidecode(unicode(text))\n        text.lower()\n        return text.encode('iso-8859-1')\n\n    def _prepare_qweb_view_data(self, qweb_name, arch):\n        return {\n            'name': qweb_name,\n            'mode': 'primary',\n            'type': 'qweb',\n            'arch': arch,\n        }\n\n    def _prepare_model_data_data(self, qweb_name, module, qweb_view):\n        return {\n            'module': module,\n            'name': qweb_name,\n            'res_id': qweb_view.id,\n            'model': 'ir.ui.view',\n        }\n\n    def _prepare_value_view_data(self, name, model):\n        return {\n            'name': name,\n            'model': model,\n            'key2': 'client_print_multi',\n            'value_unpickle': 'ir.actions.report.xml,%s' % self.id,\n        }\n\n    def _create_qweb(self, name, qweb_name, module, model, arch):\n        qweb_view_data = self._prepare_qweb_view_data(qweb_name, arch)\n        qweb_view = self.env['ir.ui.view'].create(qweb_view_data)\n        model_data_data = self._prepare_model_data_data(\n            qweb_name, module, qweb_view)\n        self.env['ir.model.data'].create(model_data_data)\n        value_view_data = self._prepare_value_view_data(\n            name, model)\n        self.env['ir.values'].sudo().create(value_view_data)\n\n    @api.model\n    def create(self, values):\n        values['report_name'] = self._format_template_name(\n            values.get('report_name', ''))\n        if (values.get('report_type') in ['qweb-pdf', 'qweb-html'] and\n                values.get('report_name') and\n                values['report_name'].find('.') == -1):\n            raise exceptions.Warning(\n                _(\"Template Name must contain at least a dot in it's name\"))\n        if not self.env.context.get('enable_duplication', False):\n            return super(IrActionsReport, self).create(values)\n        report_xml = super(IrActionsReport, self).create(values)\n        if values.get('report_type') in ['qweb-pdf', 'qweb-html']:\n            report_view_ids = self.env.context.get('report_views', False)\n            suffix = self.env.context.get('suffix') or 'copy'\n            name = values['name']\n            model = values['model']\n            report = values['report_name']\n            module = report.split('.')[0]\n            report_name = report.split('.')[1]\n            for report_view in self.env['ir.ui.view'].browse(report_view_ids):\n                origin_name = report_name.replace(('_%s' % suffix), '')\n                origin_module = module.replace(('_%s' % suffix), '')\n                new_report_name = '%s_%s' % (origin_name, suffix)\n                qweb_name = report_view.name.replace(\n                    origin_name, new_report_name)\n                arch = report_view.arch.replace(\n                    origin_name, new_report_name).replace(origin_module + '.',\n                                                          module + '.')\n                report_xml._create_qweb(\n                    name, qweb_name, module, model, arch)\n            if not report_view_ids:\n                arch = ('<?xml version=\"1.0\"?>\\n'\n                        '<t t-name=\"%s\">\\n</t>' % report_name)\n                report_xml._create_qweb(name, report_name, module, model, arch)\n        return report_xml\n\n    @api.one\n    def copy(self, default=None):\n        if not self.env.context.get('enable_duplication', False):\n            return super(IrActionsReport, self).copy(default=default)\n        if default is None:\n            default = {}\n        suffix = self.env.context.get('suffix') or 'copy'\n        default['name'] = '%s (%s)' % (self.name, suffix)\n        module = '%s_%s' % (\n            self.report_name.split('.')[0], suffix.lower())\n        report = '%s_%s' % (self.report_name.split('.')[1], suffix.lower())\n        default['report_name'] = '%s.%s' % (module, report)\n        report_views = self.env['ir.ui.view'].search([\n            ('name', 'ilike', self.report_name.split('.')[1]),\n            ('type', '=', 'qweb')])\n        return super(IrActionsReport,\n                     self.with_context(\n                         report_views=report_views.ids,\n                         suffix=suffix.lower())).copy(default=default)\n\n    @api.multi\n    def button_create_qweb(self):\n        self.ensure_one()\n        module = self.report_name.split('.')[0]\n        report_name = self.report_name.split('.')[1]\n        arch = ('<?xml version=\"1.0\"?>\\n'\n                '<t t-name=\"%s\">\\n</t>' % self.report_name)\n        self._create_qweb(self.name, report_name, module, self.model, arch)\n        self.associated_view()\n", "path": "base_report_auto_create_qweb/models/report_xml.py"}, {"content": "# -*- encoding: utf-8 -*-\n##############################################################################\n#\n#    This program is free software: you can redistribute it and/or modify\n#    it under the terms of the GNU Affero General Public License as published\n#    by the Free Software Foundation, either version 3 of the License, or\n#    (at your option) any later version.\n#\n#    This program is distributed in the hope that it will be useful,\n#    but WITHOUT ANY WARRANTY; without even the implied warranty of\n#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n#    GNU General Public License for more details.\n#\n#    You should have received a copy of the GNU Affero General Public License\n#    along with this program.  If not, see http://www.gnu.org/licenses/.\n#\n##############################################################################\n\n{\n    \"name\": \"Report qweb auto generation\",\n    \"version\": \"1.0\",\n    \"depends\": [\n        \"report\",\n    ],\n    \"external_dependencies\": {\n        \"python\": [\n            \"unidecode\",\n        ],\n    },\n    \"author\": \"OdooMRP team, \"\n              \"AvanzOSC, \"\n              \"Serv. Tecnol. Avanzados - Pedro M. Baeza, \"\n              \"Odoo Community Association (OCA), \",\n    \"website\": \"http://www.odoomrp.com\",\n    \"license\": \"AGPL-3\",\n    \"contributors\": [\n        \"Oihane Crucelaegui <oihanecrucelaegi@avanzosc.es>\",\n        \"Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>\",\n        \"Ana Juaristi <anajuaristi@avanzosc.es>\",\n    ],\n    \"category\": \"Tools\",\n    \"data\": [\n        \"wizard/report_duplicate_view.xml\",\n        \"views/report_xml_view.xml\",\n    ],\n    \"installable\": True,\n}\n", "path": "base_report_auto_create_qweb/__openerp__.py"}]}