From 4babaeb5ef7f7ff201a550b2e5f848481747378a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 20 Jan 2010 10:59:09 +0100 Subject: [PATCH] Use PySON --- sale.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sale.py b/sale.py index 07568cf34b..b9d9c606f3 100644 --- a/sale.py +++ b/sale.py @@ -2,6 +2,8 @@ #this repository contains the full copyright notices and license terms. "Sale" from trytond.model import ModelView, ModelSQL, fields +from trytond.pyson import Not, Equal, Eval + class SaleLine(ModelSQL, ModelView): _name = 'sale.line' @@ -9,7 +11,7 @@ class SaleLine(ModelSQL, ModelView): analytic_accounts = fields.Many2One('analytic_account.account.selection', 'Analytic Accounts', states={ - 'invisible': "type != 'line'", + 'invisible': Not(Equal(Eval('type'), 'line')), }) def _view_look_dom_arch(self, cursor, user, tree, type, context=None):