From c9b2f6f9e73637d39cc2ead916893f5b63c2e8b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 20 Jan 2010 11:01:14 +0100 Subject: [PATCH] Use PySON --- product.py | 3 ++- product.xml | 4 ++-- uom.py | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) 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):