Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
7192 มุมมอง

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. 

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ก.ย. 17
2658
Guides to using Odoo website builder? แก้ไขแล้ว
1
ก.ย. 17
6287
0
ต.ค. 21
1893
0
ก.ค. 19
36
1
ธ.ค. 18
6135