At present, in pyson, only the integer and float values can be compared. If we write a pyson statement as -
'invisible': Or(~Eval('state').in_(['disclose', 'signed']), (Eval('date_signed_ratee') <= Date(delta_days=15)))
Following error is raised-
Traceback (most recent call last):
File "./bin/trytond-admin", line 21, in <module>
admin.run(options)
File "/path/trytond/admin.py", line 54, in run
activatedeps=options.activatedeps)
File "/path/trytond/pool.py", line 160, in init
lang=lang, activatedeps=activatedeps)
File "/path/trytond/modules/__init__.py", line 418, in load_modules
_load_modules(update)
File "/path/trytond/modules/__init__.py", line 388, in _load_modules
load_module_graph(graph, pool, update, lang)
File "/path/trytond/modules/__init__.py", line 201, in load_module_graph
pool.setup(classes)
File "/path/trytond/pool.py", line 234, in setup
cls.__setup__()
File "/path/lib/python3.6/site-packages/trytond_apar-5.0.0-py3.6.egg/trytond/modules/apar/apar.py", line 205, in __setup__
['disclose', 'signed']), (Eval('date_signed_ratee') <= Date(delta_days=15))),
File "/path/trytond/pyson.py", line 73, in __le__
return Less(self, other, True)
File "/path/trytond/pyson.py", line 300, in __init__
'statement must be an integer or a float'
AssertionError: statement must be an integer or a float
IMO, the init method of ‘Greater’ class in pyson should be able to compare the dates as well or am I doing something wrong here.