diff --git a/bin/osv/orm.py b/bin/osv/orm.py index fed44126277..9572053b844 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -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)]