Give menu action to the button.
<button name="%(sale.action_order)d" string="test" type="action" class="oe_highlight" />
When we click on this button, Sale order menu will open.
Or Try This :-
<button name="action_view_menu" string="test" type="object" class="oe_highlight" />
In Py :-
action = self.env.ref('sale.action_order)
result = action.read()
Hope this works for you.
We know that with a menu an action is associated and based on that 'action' system performs the task. So for your requirement we can call it other way round and on button click we can return the appropriate action.
For example, you can search in odoo code here:
addons -> event -> models -> event.py : method name : action_event_registration_report
Here it tries to search for an 'action' and return the 'action'.
You can create the button of type 'action'
Hope this helps !!.
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 1/4/16, 6:28 AM|
|Seen: 817 times|
|Last updated: 1/4/16, 6:57 AM|