diff --git a/hy_odoo/xml.hy b/hy_odoo/xml.hy index 04b3ef4..20f7310 100644 --- a/hy_odoo/xml.hy +++ b/hy_odoo/xml.hy @@ -61,9 +61,10 @@ "Write XML file according to filename and given tree" `(do (import [os [path]] - [xml.etree.ElementTree :as ET]) + [xml.etree.ElementTree :as ET] + [xml.dom [minidom]]) (if-python2 - (setv ~g!output-xml (.tostring ET ~tree)) + (setv ~g!output-xml (.toprettyxml :indent " " (.parseString minidom (.tostring ET ~tree)))) (setv ~g!output-xml (.decode (.tostring ET ~tree) "utf-8"))) (setv ~g!output-path (.dirname path (.abspath path __file__)) ~g!fpath (+ ~g!output-path "/" ~filename))