Skip to Content
Menu
This question has been flagged
1 Odpoveď
7181 Zobrazenia

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?

Avatar
Zrušiť
Autor Best Answer

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. 

Avatar
Zrušiť
Related Posts Replies Zobrazenia Aktivita
0
sep 17
2651
1
sep 17
6278
0
okt 21
1882
0
júl 19
36
1
dec 18
6114