From 4bd5550e21ac7f767660d721d5bdcfa3a970e7e2 Mon Sep 17 00:00:00 2001 From: Christophe Simonis <> Date: Mon, 31 May 2010 17:05:17 +0200 Subject: [PATCH] [FIX] Fixed sql generation bug when the domain ranges on the grandparent's fields of an "inherits" hierarchy. bzr revid: jth@openerp.com-20100531150517-6q2u5ou30lfe2lqt --- bin/osv/expression.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/bin/osv/expression.py b/bin/osv/expression.py index 2ca19bbf418..4da2a70528a 100644 --- a/bin/osv/expression.py +++ b/bin/osv/expression.py @@ -71,7 +71,8 @@ class expression(object): if not reduce(lambda acc, val: acc and (self._is_operator(val) or self._is_leaf(val)), exp, True): raise ValueError('Bad domain expression: %r' % (exp,)) self.__exp = exp - self.__tables = {} # used to store the table to use for the sql generation. key = index of the leaf + self.__field_tables = {} # used to store the table to use for the sql generation. key = index of the leaf + self.__all_tables = set() self.__joins = [] self.__main_table = None # 'root' table. set by parse() self.__DUMMY_LEAF = (1, '=', 1) # a dummy leaf that must not be parsed or sql generated @@ -103,6 +104,7 @@ class expression(object): return [(left, 'in', rg(ids, table, parent or table._parent_name))] self.__main_table = table + self.__all_tables.add(table) i = -1 while i + 1