From 95f15c43d5f6c4cae2e8d6c346ac788c49fa44cc Mon Sep 17 00:00:00 2001 From: "Laurent Mignon (ACSONE)" Date: Wed, 31 May 2017 12:22:37 +0200 Subject: [PATCH] [10.0] help_online fix export/import (#584) * [FIX] help_online: Replace obsolete icon into the export wizard * [FIX] help_online: Add the key attribute into the exported data This key is required to get the pages properly imported as web pages * Use the correct method for combining strings This handles type conversions properly --- help_online/tests/common.py | 1 + help_online/tests/test_export_help_wizard.py | 2 ++ help_online/wizards/export_help_wizard.py | 1 + help_online/wizards/export_help_wizard_view.xml | 2 +- 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/help_online/tests/common.py b/help_online/tests/common.py index a2d5e842..18dad8f2 100644 --- a/help_online/tests/common.py +++ b/help_online/tests/common.py @@ -81,6 +81,7 @@ class TestWizardCommon(object): 'type': 'qweb', 'arch': arch, 'page': True, + 'key': 'website.%' % pageName } view_id = self.env['ir.ui.view'].create(vals) return view_id.id diff --git a/help_online/tests/test_export_help_wizard.py b/help_online/tests/test_export_help_wizard.py index 933ca3cb..44b4a5c0 100644 --- a/help_online/tests/test_export_help_wizard.py +++ b/help_online/tests/test_export_help_wizard.py @@ -31,6 +31,8 @@ class TestExportHelpWizard(TestWizardCommon): templateNodeList = rootXml.findall(xPath) self.assertEqual(len(templateNodeList), 1) self.assertNotIn("website.", templateNodeList[0].attrib['name']) + self.assertEqual( + "website." + self.pageName, templateNodeList[0].attrib['key']) if self.imgXmlId: xPath = ".//record[@id='%s']" % self.imgXmlId diff --git a/help_online/wizards/export_help_wizard.py b/help_online/wizards/export_help_wizard.py index e7c7da91..71e84568 100644 --- a/help_online/wizards/export_help_wizard.py +++ b/help_online/wizards/export_help_wizard.py @@ -236,6 +236,7 @@ class ExportHelpWizard(models.TransientModel): root.attrib['name'] = ir_ui_view.name.replace('website.', '') root.attrib['id'] = xml_id root.attrib['page'] = 'True' + root.attrib['key'] = ir_ui_view.key self._manage_images_on_page(root, data_node, exported_resources) self._clean_href_urls(root, page_prefix, template_prefix) diff --git a/help_online/wizards/export_help_wizard_view.xml b/help_online/wizards/export_help_wizard_view.xml index 3b281200..4e4b7da6 100644 --- a/help_online/wizards/export_help_wizard_view.xml +++ b/help_online/wizards/export_help_wizard_view.xml @@ -28,7 +28,7 @@