The action manager can be invoked explicitly from javascript code by creating a dictionary describing an action of the right type, and calling an action manager instance with it.
In below example I have written javascript to Include only parent level class. Like given below code in .js file : -
instance.web.TestWidget = instance.Widget.extend({
dispatch_to_new_action: function() {
this.do_action({
type: 'ir.actions.act_window',
res_model: "product.product",
res_id: 1,
views: [[false, 'form']],
target: 'current',
context: {},
});
},
});
Note- do_action() is a shortcut of Widget() looking up the "current" action manager and executing the action.
0 Comment(s)