Hello,
I am using Odoo 15.
I am trying to call do_action from JavaScript. In my do_action call, I need to return an action and a view, but I only know the name of my view.
I tried to do the below rpc call to find my view_id, but it isn't working.
rpc.query({
// Get view id
model:'ir.model.data',
method:'xmlid_to_res_model_res_id',
args:
['my_module.'my_view_name], //
View id goes
here
}).then(function(data){
self.do_action({
name:'view
name',
type: 'ir.actions.act_window',
res_model: 'my_model',
view_mode: 'form',
views:
[[data[1], 'form']],
})
});
But this throws this error:
*****AttributeError: type object 'ir.model.data' has no attribute 'xmlid_to_res_model_res_id'*****
Please let me know the correct way to make rpc calls in Odoo 15.
Thanks.