[FIX]Hy Odoo : replace nth

This commit is contained in:
Fabien BOURGEOIS 2022-11-01 18:58:13 +01:00
parent 52ed13524b
commit f7d5ba3465
3 changed files with 4 additions and 4 deletions

View File

@ -25,8 +25,8 @@
(defmacro hydm [hy-domain] (defmacro hydm [hy-domain]
"Generate Odoo domain from Hy like tuple domain" "Generate Odoo domain from Hy like tuple domain"
(setv op (second hy-domain) (setv op (second hy-domain)
field (mangle (nth hy-domain 2)) field (mangle (get hy-domain 2))
value (nth hy-domain 3)) value (get hy-domain 3))
`#(~field ~op ~value)) `#(~field ~op ~value))
; Odoo ORM macros ; Odoo ORM macros

View File

@ -102,7 +102,7 @@
; Fields ; Fields
(defn field [&rest args] (defn field [&rest args]
"Special field allowing mangling name attribute" "Special field allowing mangling name attribute"
(setv attrs (nth args 0)) (setv attrs (get args 0))
(when (and (instance? dict attrs) (in "name" attrs)) (when (and (instance? dict attrs) (in "name" attrs))
(assoc attrs "name" (mangle (get attrs "name"))) (assoc attrs "name" (mangle (get attrs "name")))
(setv args (list args)) (setv args (list args))

View File

@ -18,7 +18,7 @@ class install(install):
setup( setup(
name="hy_odoo", name="hy_odoo",
version="0.8.0pre", version="0.8.1pre",
packages=find_packages(), packages=find_packages(),
package_data={ package_data={
'hy_odoo': ['*.hy'], 'hy_odoo': ['*.hy'],