I want to create a special custom view for kanban. This view has to have special View Manager too.
In my_module_view.xml file I have menuitem and action definition. Action has context:
<field name="context">{'special_view': True}</field>
Into my_module.js file I want to change template of instance.web.ViewManager only when context has 'special_view' true.
init: function (parent, dataset, view_id, options) {
if (this.dataset.context.special_view) {
this.template = "MyViewManager";
}
this._super(parent, dataset, view_id, options);
},
Unfortunately, this.dataset is null and I get this exception: Uncaught TypeError: Cannot read property 'context' of undefined.Is there another way to change this template according to special_view value of context?
Thank you.