Make PYSON more Pythonic
This commit is contained in:
@@ -5,7 +5,7 @@ from collections import deque, defaultdict
|
||||
from heapq import heappop, heappush
|
||||
from trytond.model import ModelView, ModelSQL, fields
|
||||
from trytond.wizard import Wizard
|
||||
from trytond.pyson import Eval, Not, Equal
|
||||
from trytond.pyson import Eval
|
||||
from trytond.transaction import Transaction
|
||||
from trytond.pool import Pool
|
||||
|
||||
@@ -34,8 +34,8 @@ class Work(ModelSQL, ModelView):
|
||||
leveling_delay = fields.Float("Leveling Delay")
|
||||
back_leveling_delay = fields.Float("Leveling Delay")
|
||||
allocations = fields.One2Many('project.allocation', 'work', 'Allocations',
|
||||
states={
|
||||
'invisible': Not(Equal(Eval('type'), 'task')),
|
||||
states={
|
||||
'invisible': Eval('type') != 'task',
|
||||
}, depends=['type'])
|
||||
duration = fields.Function(fields.Float('Duration'), 'get_function_fields')
|
||||
early_start_time = fields.DateTime("Early Start Time", readonly=True)
|
||||
|
||||
Reference in New Issue
Block a user