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
7463 Widoki

I need to call method "new_page" in one module from another. I made a button to call this function.
In templates:

<a href="#" data-action="method_add" aria-label="New page" title="New page">
<p>New Page</p>
</a>

In models i defined the action:

@api.model
def method_add(self, name=False, add_menu=False, template='website.default_page', ispage=True, namespace=None):
   self.env.ref('website').new_page
   return True


This method must call function from module. But nothing happens. 

Is it  required to make a new controller?

Awatar
Odrzuć
Autor Najlepsza odpowiedź

new_webpage_web = self.env['website'].new_page() - this expression calls function def new_page() from module website.
But the logic of website builder: first js functions create input values and only then def new_page() creates a new page. Now I don’t know how to call js. 

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
wrz 17
2911
1
wrz 17
6537
0
paź 21
2186
0
lip 19
36
1
gru 18
6444