コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
7220 ビュー

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?

アバター
破棄
著作者 最善の回答

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. 

アバター
破棄
関連投稿 返信 ビュー 活動
0
9月 17
2684
1
9月 17
6304
0
10月 21
1927
0
7月 19
36
1
12月 18
6180