diff --git a/yaltik_dsl/__manifest__.py b/yaltik_dsl/__manifest__.py index 886dad6..d8879f2 100644 --- a/yaltik_dsl/__manifest__.py +++ b/yaltik_dsl/__manifest__.py @@ -19,7 +19,7 @@ 'name': 'Yaltik Odoo DSL base module and fns', 'summary': 'Yaltik Odoo Domain Specific Language base module and functions', 'description': """ Yaltik Odoo Domain Specific Language base module and functions """, - 'version': '10.0.0.2.2', + 'version': '10.0.0.2.3', 'category': 'Yaltik', 'author': 'Fabien Bourgeois', 'license': 'AGPL-3', diff --git a/yaltik_dsl/xml_base.py b/yaltik_dsl/xml_base.py index b92cd2a..faaa295 100644 --- a/yaltik_dsl/xml_base.py +++ b/yaltik_dsl/xml_base.py @@ -52,8 +52,9 @@ def xmln(tag='', attrs=None, children=None, text=False): def xml_write(filepath, tree): """ Write XML file according to filename and given tree """ - output_xml = minidom.parseString(ET.tostring(tree)).toprettyxml(indent=' ') - output_path = path.dirname(path.abspath(filepath)) - fpath = '%s/%s' % (output_path, path.basename(filepath).replace('.py', '_views.xml')) - with open(fpath, 'w') as output_file: - output_file.write(output_xml) + if filepath.endswith('.py'): # if .pyc, no need to generate XML + output_xml = minidom.parseString(ET.tostring(tree)).toprettyxml(indent=' ') + output_path = path.dirname(path.abspath(filepath)) + fpath = '%s/%s' % (output_path, path.basename(filepath).replace('.py', '_views.xml')) + with open(fpath, 'w') as output_file: + output_file.write(output_xml)