diff --git a/CHANGELOG b/CHANGELOG index ad67146215..ebd2d55389 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Add reversed operators to PYSON expressions + Version 3.6.0 - 2015-04-20 * Bug fixes (see mercurial logs for details) * Hide columns containing always the same value diff --git a/tryton/pyson.py b/tryton/pyson.py index 7f55826622..cc8d0c6e7c 100644 --- a/tryton/pyson.py +++ b/tryton/pyson.py @@ -56,6 +56,8 @@ class PYSON(object): else: return And(self, other) + __rand__ = __and__ + def __or__(self, other): if (isinstance(other, PYSON) and other.types() != set([bool])): @@ -68,6 +70,8 @@ class PYSON(object): else: return Or(self, other) + __ror__ = __or__ + def __eq__(self, other): return Equal(self, other)