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

Hello Everybody!

I read more tutorial about Window Action

this is one tutorial https://www.odoo.com/forum/help-1/question/how-to-open-a-new-form-when-i-click-in-a-button-66751

I have method like this in my custom model

@api.multi
def method_name(self):
view_id = self.env.ref('modul_name._id_of_form_view').id
context = self._context.copy()
return {
'name':'form_name',
'view_type':'form',
'view_mode':'tree',
'views' : [(view_id,'form')],
'res_model':'model_name',
'view_id':view_id,
'type':'ir.actions.act_window',
'res_id':self.id,
'target':'new',
'context':context,
}

<button name="method_name" string="open_form" type="object"/> 

With xml button i can call method and then return action and the view is rendered, but with Javascript, the view not render

Anyone have solutions for my issue? I want use javascript to call Window Action method in model and return action render view

And xml button not render in template tag (<template></template>), right? How i can define button xml to call action in template

Pls help me! Thank you!

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
maj 21
3013
2
maj 20
9623
1
sty 20
4862
0
mar 19
3242
3
maj 22
9083