1
votes

In an Odoo view, I can create a button to trigger a specific window action by giving the button a name equal to the database identifier for the action. For example:

<button type="action" name="123">Trigger</button>

Will trigger action id 123 when clicked.

Is it possible to accomplish the same thing using the XML ID of the action rather than the database ID?

I'm asking because I have created a module full of data files that include view and window actions. The views include a reference to the ID of the window action since they contain buttons to trigger them. However, I don't know the ID's of the window actions until the module is imported, so I can't include them in the views on the initial import.

Is there any way around this?

1

1 Answers

2
votes

Found my answer:

<button type="action" name="%(xml_id_of_action)d"></button>