Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
7070 Widoki

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.

Awatar
Odrzuć
Najlepsza odpowiedź

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.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
cze 23
2568
1
cze 23
2345
1
kwi 22
4970
6
paź 15
5238
0
maj 15
12449