forked from Techsystech/web
[FIX] help_online: avoid removal of exported pages
Always use the '__export__' prefix when generating the xmlid of pages exported by the export wizard to avoid autmomatic removal of these pages by Odoo on system update (-u)10.0
parent
1a5b413d43
commit
4f6c1ff671
|
@ -27,7 +27,7 @@ class TestExportHelpWizard(TestWizardCommon):
|
|||
parser = ET.XMLParser(remove_blank_text=True)
|
||||
rootXml = ET.XML(xmlData, parser=parser)
|
||||
|
||||
xPath = ".//template[@id='website.%s']" % self.pageName
|
||||
xPath = ".//template[@id='__export__.%s']" % self.pageName
|
||||
templateNodeList = rootXml.findall(xPath)
|
||||
self.assertEqual(len(templateNodeList), 1)
|
||||
self.assertNotIn("website.", templateNodeList[0].attrib['name'])
|
||||
|
@ -47,7 +47,7 @@ class TestExportHelpWizard(TestWizardCommon):
|
|||
self.assertIn("/web/image/%s" % self.imgXmlId, imgSrc)
|
||||
|
||||
if self.pageTemplate:
|
||||
xPath = ".//template[@id='website.%s_snippet']" % self.pageName
|
||||
xPath = ".//template[@id='__export__.%s_snippet']" % self.pageName
|
||||
templateNodeList = rootXml.findall(xPath)
|
||||
self.assertEqual(len(templateNodeList), 1)
|
||||
self.assertNotIn("website.", templateNodeList[0].attrib['name'])
|
||||
|
|
|
@ -271,6 +271,10 @@ class ExportHelpWizard(models.TransientModel):
|
|||
return data[0].name
|
||||
else:
|
||||
module, name = template_name.split('.')
|
||||
# always use __export__ as module by convention to
|
||||
# avoid the removal by odoo of the exported pages on system
|
||||
# update (-u )
|
||||
module = "__export__"
|
||||
postfix = ir_model_data.search_count(
|
||||
[('module', '=', module),
|
||||
('name', 'like', name)])
|
||||
|
|
Loading…
Reference in New Issue