[MERGE] merge bzr saas-3 server branch
This commit is contained in:
commit
e046626093
|
@ -236,7 +236,7 @@ class view(osv.osv):
|
||||||
['type', '=', view_type],
|
['type', '=', view_type],
|
||||||
['inherit_id', '=', False],
|
['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:
|
if not ids:
|
||||||
return False
|
return False
|
||||||
return ids[0]
|
return ids[0]
|
||||||
|
|
|
@ -5083,7 +5083,14 @@ class BaseModel(object):
|
||||||
# shortcut read if we only want the ids
|
# shortcut read if we only want the ids
|
||||||
return [{'id': id} for id in record_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:
|
if len(result) <= 1:
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue