diff --git a/product.py b/product.py
index a4f2cb7ab1..a89a4a0791 100644
--- a/product.py
+++ b/product.py
@@ -1,9 +1,10 @@
#This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
from trytond.model import ModelView, ModelSQL, fields
+from trytond.pyson import Not, Bool, Eval
STATES = {
- 'readonly': "active == False",
+ 'readonly': Not(Bool(Eval('active'))),
}
diff --git a/product.xml b/product.xml
index 0a459d9ded..76788f45f6 100644
--- a/product.xml
+++ b/product.xml
@@ -165,8 +165,8 @@ this repository contains the full copyright notices and license terms. -->
Product by Category
product.product
form
- {'categories': [active_id]}
- [('category','child_of', [active_id], 'parent')]
+ {'categories': [Eval('active_id')]}
+ [('category','child_of', [Eval('active_id')], 'parent')]
diff --git a/uom.py b/uom.py
index fd2dd91e44..b8f6f304f5 100644
--- a/uom.py
+++ b/uom.py
@@ -2,10 +2,11 @@
#this repository contains the full copyright notices and license terms.
from trytond.model import ModelView, ModelSQL, fields
from trytond.model.modelstorage import OPERATORS
+from trytond.pyson import Not, Bool, Eval
from decimal import Decimal
STATES = {
- 'readonly': "(active == False)",
+ 'readonly': Not(Bool(Eval('active'))),
}
class UomCategory(ModelSQL, ModelView):