diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index e9f4d8f59bd..8fe7bb1df7f 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -5083,7 +5083,14 @@ class BaseModel(object): # shortcut read if we only want the ids return [{'id': id} for id in record_ids] - result = self.read(cr, uid, record_ids, fields, context=context) + # read() ignores active_test, but it would forward it to any downstream search call + # (e.g. for x2m or function fields), and this is not the desired behavior, the flag + # was presumably only meant for the main search(). + # TODO: Move this to read() directly? + read_ctx = dict(context or {}) + read_ctx.pop('active_test', None) + + result = self.read(cr, uid, record_ids, fields, context=read_ctx) if len(result) <= 1: return result