Rational
Sometimes, we would like to be able to define a domain on an Act WIndow which relies on the current date / time to filter out some results. I am not aware of any possibility to implement this kind of behaviour in tryton.
Proposal
Add two new keywords to PYSON, in order to be able to declare domains such as :
- [(‘date’, ‘<’, Today())]
- [(‘create_date’, ‘<’, Now())]
Those keywords could optionnaly accept parameters to declare an offset, like :
- [(‘date’, ‘>=’, Today(months=-2))]
- [(‘created_date’, ‘>=’, Now(hours=-2))]
Constraints
I do not think that those keyword should be used to enforce constraints on fields, since they may become invalid just by waiting. Their intended use is primarily filtering in client side actions. Ideally, the server side implementation should be a no-op.
Also, it will be necessary to update the tab_domain behaviour client side to re-evaluate the domain when refreshing.