Do not fail to get keyword action with empty record id
Closes #12767 (grafted from 9b28b3b64550681b1ff2b37c7dcaa82874032c42) --HG-- branch : 7.0
This commit is contained in:
1 parent
2c17cfba48
commit
f5d11ae7c2
1 file changed
+6
-5
@@ -262,7 +262,7 @@ class ActionKeyword(ModelSQL, ModelView):
|
||||
if keywords is not None:
|
||||
return keywords
|
||||
keywords = []
|
||||
model, model_id = value
|
||||
model, record_id = value
|
||||
|
||||
clause = [
|
||||
('keyword', '=', keyword),
|
||||
@@ -271,12 +271,12 @@ class ActionKeyword(ModelSQL, ModelView):
|
||||
('model', '=', None),
|
||||
],
|
||||
]
|
||||
if model_id >= 0:
|
||||
if record_id is not None and record_id >= 0:
|
||||
clause = ['OR',
|
||||
clause,
|
||||
[
|
||||
('keyword', '=', keyword),
|
||||
('model', '=', model + ',' + str(model_id)),
|
||||
('model', '=', model + ',' + str(record_id)),
|
||||
],
|
||||
]
|
||||
clause = [clause, ('action.active', '=', True)]
|
||||
@@ -294,8 +294,9 @@ class ActionKeyword(ModelSQL, ModelView):
|
||||
continue
|
||||
value['keyword'] = keyword
|
||||
keywords.append(value)
|
||||
if keyword == 'tree_open' and model == Menu.__name__:
|
||||
menu = Menu(model_id)
|
||||
if (record_id is not None
|
||||
and keyword == 'tree_open' and model == Menu.__name__):
|
||||
menu = Menu(record_id)
|
||||
for value in keywords:
|
||||
if value['type'] == 'ir.action.act_window':
|
||||
if len(keywords) == 1:
|
||||
|
||||
Reference in new issue
Block a user