Search and get keys in one request for Dict fields
issue10332 review349751003
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
* Combine search and get_keys in DictSchemaMixin
|
||||
* Make language code unique
|
||||
* Support base64 encoded data in ModelStorage.import_data
|
||||
* Add BOOL_AND and BOOL_OR to SQLite backend
|
||||
|
||||
@@ -91,6 +91,7 @@ class DictSchemaMixin(object):
|
||||
super(DictSchemaMixin, cls).__setup__()
|
||||
cls.__rpc__.update({
|
||||
'get_keys': RPC(instantiate=0),
|
||||
'search_get_keys': RPC(),
|
||||
})
|
||||
|
||||
@staticmethod
|
||||
@@ -178,6 +179,11 @@ class DictSchemaMixin(object):
|
||||
keys.append(new_key)
|
||||
return keys
|
||||
|
||||
@classmethod
|
||||
def search_get_keys(cls, domain, limit=None):
|
||||
schemas = cls.search(domain, limit=limit)
|
||||
return cls.get_keys(schemas)
|
||||
|
||||
@classmethod
|
||||
def get_relation_fields(cls):
|
||||
if not config.get('dict', cls.__name__, default=True):
|
||||
|
||||
Reference in New Issue
Block a user