Commit 0e2b012f authored by Georgios Dagkakis's avatar Georgios Dagkakis

BusinessTemplate.py: Class CatalogKeyTemplateItemBase: fix so that in export...

BusinessTemplate.py: Class CatalogKeyTemplateItemBase: fix so that in export the items are exported in the correct folder
parent 4358ba18
...@@ -4233,7 +4233,7 @@ class CatalogKeyTemplateItemBase(BaseTemplateItem): ...@@ -4233,7 +4233,7 @@ class CatalogKeyTemplateItemBase(BaseTemplateItem):
elif not self.is_bt_for_diff: elif not self.is_bt_for_diff:
raise NotFound, '%s %r not found in catalog' %(self.key_title, key) raise NotFound, '%s %r not found in catalog' %(self.key_title, key)
if len(key_list) > 0: if len(key_list) > 0:
self._objects['%s/%s' % (self.__class__.__name__, self.key_list_title)] = key_list self._objects[self.key_list_title] = key_list
def _importFile(self, file_name, file): def _importFile(self, file_name, file):
if not file_name.endswith('.xml'): if not file_name.endswith('.xml'):
...@@ -4300,9 +4300,10 @@ class CatalogKeyTemplateItemBase(BaseTemplateItem): ...@@ -4300,9 +4300,10 @@ class CatalogKeyTemplateItemBase(BaseTemplateItem):
def export(self, context, bta, **kw): def export(self, context, bta, **kw):
if len(self._objects.keys()) == 0: if len(self._objects.keys()) == 0:
return return
for path in self._objects.keys(): for name in self._objects.keys():
xml_data = self.generateXml(path=path) path = self.__class__.__name__
bta.addObject(xml_data, name=path) xml_data = self.generateXml(path=name)
bta.addObject(xml_data, name=name, path=path)
class CatalogUniqueKeyTemplateItemBase(CatalogKeyTemplateItemBase): class CatalogUniqueKeyTemplateItemBase(CatalogKeyTemplateItemBase):
# like CatalogKeyTemplateItemBase, but for keys which use # like CatalogKeyTemplateItemBase, but for keys which use
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment