Skip to Content
Menu
This question has been flagged
2770 Views

I am trying to show form view of a specific object through js code using

self.action_manager.do_action.

Code to show Tree View of a specific record

self.action_manager.do_action({               

    type: 'ir.actions.act_window',               

    view_type: 'list',               

    view_mode: 'list,form',               

    res_model: res_model,               

    domain: [['id', '=', res_id]],               

    views: [[false, 'list'], [false, 'form']],               

    target: 'new'           

});

This code works and helps me open up a Tree View of the given res_model with res_id. But I would like to know how to call and show Form View of the same record. I have tried using the 'form' instead of 'list' in above code as follows,

Code tried to show Form View of a specific record

    view_type: 'form',           

    view_mode: 'form',           

    res_model: res_model,           

    domain: [['id', '=', res_id]],           

    views: [[false, 'form']],           

    target: 'current'

And this doesn't help..

Can anyone help me on this. Basically i have the record details in js and want to display the record in its own form view. Thanks a lot for helping me out.



Avatar
Discard