[MERGE] merge bzr saas-3 server branch

This commit is contained in:
Christophe Simonis 2014-05-20 16:41:04 +02:00
commit e046626093
2 changed files with 9 additions and 2 deletions

View File

@ -236,7 +236,7 @@ class view(osv.osv):
['type', '=', view_type],
['inherit_id', '=', False],
]
ids = self.search(cr, uid, domain, limit=1, order='priority', context=context)
ids = self.search(cr, uid, domain, limit=1, context=context)
if not ids:
return False
return ids[0]

View File

@ -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