Commit 49d87cf5 authored by Vincent Pelletier's avatar Vincent Pelletier

Add support for multiple site properties in imported BTs.

parent 3f614007
...@@ -3106,15 +3106,15 @@ class SitePropertyTemplateItem(BaseTemplateItem): ...@@ -3106,15 +3106,15 @@ class SitePropertyTemplateItem(BaseTemplateItem):
LOG('Business Template', 0, 'Skipping file "%s"' % (file_name, )) LOG('Business Template', 0, 'Skipping file "%s"' % (file_name, ))
return return
xml = parse(file) xml = parse(file)
property_node = xml.getroot()[0] for property_node in xml.getroot().findall('property'):
property_id = property_node.find('id').text property_id = property_node.find('id').text
prop_type = property_node.find('type').text prop_type = property_node.find('type').text
value_node = property_node.find('value') value_node = property_node.find('value')
if prop_type in ('lines', 'tokens'): if prop_type in ('lines', 'tokens'):
value = [item.text for item in value_node.findall('item')] value = [item.text for item in value_node.findall('item')]
else: else:
value = value_node.text value = value_node.text
self._objects[property_id] = (prop_type, value) self._objects[property_id] = (prop_type, value)
def install(self, context, trashbin, **kw): def install(self, context, trashbin, **kw):
update_dict = kw.get('object_to_update') update_dict = kw.get('object_to_update')
......
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