From d5c90554302e0dbeff79b7fdc45537e8ee75a746 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 20 Jan 2010 10:58:52 +0100 Subject: [PATCH] Use PySON --- invoice.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/invoice.py b/invoice.py index 86a3fd9655..dad3475c83 100644 --- a/invoice.py +++ b/invoice.py @@ -2,6 +2,7 @@ #this repository contains the full copyright notices and license terms. "Invoice" from trytond.model import ModelView, ModelSQL, fields +from trytond.pyson import Not, Equal, Eval class InvoiceLine(ModelSQL, ModelView): @@ -10,7 +11,7 @@ class InvoiceLine(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):