El 24/11/17 a les 12:02, Maxime Richez ha escrit:
You have some examples in the test suite:
http://hg.tryton.org/trytond/file/34073513c887/trytond/tests/test_modelview.py#l194
Have you tried?:
Eval('self', {}).get('total_amount', 0) > 500
Hope it helps.
Thanks but we are testing from the tryton client, and expression is not a valid
Pyson expression. Is there a way to convert your expression in the gui client ?
We convert your expression with PYTHONEncoder and then we introduce the result
in the GUI, and it's working whith this value:
{"s2": 500, "s1": {"d": 0, "k": "total_amount", "__class__": "Get", "v": {"d": {}, "__class__": "Eval", "v":
"self"}}, "e": false, "__class__": "Greater"}
Is there a tool in the gui to convert expression to Pyson ?
Indeed there is a widget to manipulate the pyson statements on the
tryton client [1]. You should be able to enter the pyson expresion on
client and it will automatically encode the values when sending to the
server.
But I see the widget is not activated for this field.
I will create an issue in order to fix it.
Thanks,
[1] https://bugs.tryton.org/issue4631
--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk
--
You received this message because you are subscribed to the Google Groups
"tryton-dev" group.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tryton-dev/0db91268-bd6e-2585-3737-0c0968510123%40koolpi.com.