Get name for wizards not linked to a model
Closes #14033 (grafted from 20cdba7a1bf3738eba3d474d4d5f366a758d1010) --HG-- branch : 7.0
This commit is contained in:
@@ -1090,8 +1090,12 @@ class ActionWizard(ActionMixin, ModelSQL, ModelView):
|
||||
# TODO add cache
|
||||
actions = cls.search([
|
||||
(cls._action_name, '=', name),
|
||||
('model', '=', model),
|
||||
], limit=1)
|
||||
['OR',
|
||||
('model', '=', model),
|
||||
('model', '=', None),
|
||||
],
|
||||
],
|
||||
order=[('model', 'ASC NULLS LAST')])
|
||||
if actions:
|
||||
action, = actions
|
||||
return action.name
|
||||
|
||||
Reference in New Issue
Block a user