StateView fails with Greater Pyson evaluation
I noticed the following problem.
I have a wizard, with a StateView. This StateView has a domain on a field
which depends on a Pyson If expression. This expression is :
Eval('write_off', 0) > 0
(I was trying to override the account.reconcile.show model)
The problem is that when the client displays the wizard, tries to evaluate
the pyson expression (in [1]) before setting the default values [2].
So the Eval('write_off', 0) resolves to 'None', which then causes a crash at [3].
I tried overriding the 'get_eval' method in FloatField to return 0 rather than
None, and it seems to work, though it may not be the best solution.
[1] http://hg.tryton.org/tryton/file/e720786195ec/tryton/gui/window/wizard.py#l224
[2] http://hg.tryton.org/tryton/file/e720786195ec/tryton/gui/window/wizard.py#l225 [3] http://hg.tryton.org/tryton/file/e720786195ec/tryton/pyson.py#l349