[IMP]Hy Base : new macro for server actions
This commit is contained in:
parent
e2796dc29b
commit
217a64ab68
@ -44,6 +44,15 @@
|
|||||||
(ox-field-inherit ~inherit)
|
(ox-field-inherit ~inherit)
|
||||||
(ox-field-arch ~@body)])))
|
(ox-field-arch ~@body)])))
|
||||||
|
|
||||||
|
(defmacro ox-actions-server-code [xmlid name modelref code]
|
||||||
|
"Server actions of type code"
|
||||||
|
`(do
|
||||||
|
(ox-record {"id" ~xmlid "model" "ir.actions.server"}
|
||||||
|
[(ox-field-name ~name)
|
||||||
|
(ox-field {"name" "model_id" "ref" ~modelref} [])
|
||||||
|
(ox-field {"name" "state"} ["code"])
|
||||||
|
(ox-field {"name" "code"} #[[~code]])])))
|
||||||
|
|
||||||
(defmacro ox-field [&rest args] `(xmlna "field" ~@args))
|
(defmacro ox-field [&rest args] `(xmlna "field" ~@args))
|
||||||
(defmacro ox-field-name [name] `(ox-field {"name" "name"} [~name]))
|
(defmacro ox-field-name [name] `(ox-field {"name" "name"} [~name]))
|
||||||
(defmacro ox-field-model [model] `(ox-field {"name" "model"} [~model]))
|
(defmacro ox-field-model [model] `(ox-field {"name" "model"} [~model]))
|
||||||
|
Loading…
Reference in New Issue
Block a user