From 18b963d2cd5a8880befb7dd5820dc6f6e3a4215a Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Mon, 27 Apr 2020 11:29:07 +0200 Subject: [PATCH] [IMP]Hy Odoo : allow XML data to have attributes, add XML node function --- hy_odoo/odoo.hy | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hy_odoo/odoo.hy b/hy_odoo/odoo.hy index 929d669..46c023c 100644 --- a/hy_odoo/odoo.hy +++ b/hy_odoo/odoo.hy @@ -40,7 +40,11 @@ ; XML helpers functions and macros (defn odoo [&rest args] (xmlroot (xmln "odoo" {} #*args))) -(defn data [&rest args] (xmln "data" {} #*args)) +(defn data [&rest args] + (if (= (len args) 1) + (xmln "data" {} #*args) + (xmln "data" #*args))) +(defn function [&rest args] (xmln "function" #*args)) (defn record [&rest args] (xmln "record" #*args)) (defn form [&rest args] (xmln "form" #*args)) (defn tree [&rest args] (xmln "tree" #*args))