Make PYSON more Pythonic

This commit is contained in:
Cédric Krier
2011-08-21 11:20:45 +02:00
parent d1e910f66e
commit 8eb0566a0b
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
#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 Model, fields
from trytond.pyson import Not, Bool, Eval
from trytond.pyson import Eval
import luhn
@@ -9,7 +9,7 @@ class Address(Model):
_name = 'party.address'
siret_nic = fields.Char('SIRET NIC', select=1, states={
'readonly': Not(Bool(Eval('active'))),
'readonly': ~Eval('active', True),
}, size=5, depends=['active'])
siret = fields.Function(fields.Char('SIRET'), 'get_siret')
+2 -2
View File
@@ -1,7 +1,7 @@
#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 Model, fields
from trytond.pyson import Not, Bool, Eval
from trytond.pyson import Eval
import luhn
@@ -9,7 +9,7 @@ class Party(Model):
_name = 'party.party'
siren = fields.Char('SIREN', select=1, states={
'readonly': Not(Bool(Eval('active'))),
'readonly': ~Eval('active', True),
}, size=9, depends=['active'])
def __init__(self):