Skip to Content
Menu
This question has been flagged

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
Discard
Author 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
Discard
Related Posts Replies Views Activity
0
Sep 17
2021
1
Sep 17
5401
0
Oct 21
1066
0
Jul 19
36
1
Dec 18
5236