[IMP]New hydm macro to craft hy style domain tuple

This commit is contained in:
Fabien BOURGEOIS 2020-03-27 16:16:24 +01:00
parent a170137504
commit 06b1371255
2 changed files with 8 additions and 1 deletions

View File

@ -30,6 +30,13 @@
value (if (string? value) f"'{value}'" value))
(return f"('{field}', '{op}', {value})")))
(defmacro hydm [hy-domain]
"Generate Odoo domain from Hy like tuple domain"
(setv op (second hy-domain)
field (mangle (nth hy-domain 2))
value (nth hy-domain 3))
`(, ~field ~op ~value))
; XML helpers functions and macros
(defn ox-odoo [&rest args] (xmlroot (xmln "odoo" {} #*args)))

View File

@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup(
name="hy_odoo",
version="0.2.0",
version="0.2.1",
packages=find_packages(),
package_data={
'hy_odoo': ['*.hy'],