From a3c9ba0b90a1e475cede0355ac8d0065165cc44d Mon Sep 17 00:00:00 2001 From: ced <> Date: Tue, 29 Jan 2008 15:05:53 +0000 Subject: [PATCH] Fix max_stack_depth by adding internal inselect clause bzr revid: ced-56ab35cd89c69aa51a1e84088110d66c92c14025 --- bin/osv/orm.py | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index e083c898740..ce39bba8617 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -1707,6 +1707,9 @@ class orm(object): joins=[] while i 3: table=x[3] - if x[1] != 'in': + if x[1] == 'inselect': + qu1.append('(%s.%s in (%s))' % (table._table, x[0], x[2][0])) + qu2 += x[2][1] + elif x[1] != 'in': #FIXME: this replace all (..., '=', False) values with 'is null' and this is # not what we want for real boolean fields. The problem is, we can't change it # easily because we use False everywhere instead of None