[IMP]New hydm macro to craft hy style domain tuple
This commit is contained in:
parent
a170137504
commit
06b1371255
@ -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)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user