Bugfix: Search inactive (active = False) elements will always fail
Even if args contain ['active','=',0], _where_calc function add an active test, leading to 'where active = True and active = False' SQL queries. bzr revid: x.alt@ajm.lu-20081030154226-7yd1xvqleisqksld
This commit is contained in:
+6
-1
@@ -2354,7 +2354,12 @@ class orm(orm_template):
|
||||
# records unless they were explicitely asked for
|
||||
if 'active' in self._columns and (active_test and context.get('active_test', True)):
|
||||
if args:
|
||||
args.insert(0, ('active', '=', 1))
|
||||
active_in_args = False
|
||||
for a in args:
|
||||
if a[0] == 'active':
|
||||
active_in_args = True
|
||||
if not active_in_args:
|
||||
args.insert(0, ('active', '=', 1))
|
||||
else:
|
||||
args = [('active', '=', 1)]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user