Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
7473 Vizualizări

I want to open view by using the js file, 

code: 

res = self.pool['ir.model.data'].get_object_reference(cr, uid, 'my_module', 'my_view_id')

return {

'view_type': 'form',

'view_mode': 'form',

'view_id': res[1],

'res_model': '',

'type': 'ir.actions.act_window',

'target': 'current',

}


I created python function which returns the view, but as I am returning the view it is return to the JS and not opening the view. So, I want to know that how to open this view from the JS. As some tree view are opening in POS using JS but I am not getting how to open Graph view or Form View.

Imagine profil
Abandonează
Cel mai bun răspuns

Hello Khatri,

You can call action from js by this way..

return this.do_action({

     type: 'ir.actions.act_window',

     name: this.string,

     res_model: this.field.relation,

     views: this.options.views,

     target: 'current',

     context: context,

     domain: domain,

});

But you have created function that return action in python. as you said that function not work properly. So would like to suggest first try to use @api.multi in python function.


Hope this helps.

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
2
iun. 23
2901
1
iun. 23
2697
1
apr. 22
5348
6
oct. 15
5529
0
mai 15
12814