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

my function is defined in the website controller and I wish to call it from a model, e.g (res.partner) 

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

You can do this by:

Importing the controller into the model and then you can call the function from the controller. for eg:

from odoo.addons.module_name.controllers.main import class_name_of_the_controller.
Thank you.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ก.ค. 24
2148
1
ส.ค. 15
3553
2
ธ.ค. 21
24026
Get model data in a controller แก้ไขแล้ว
4
ต.ค. 21
37103
1
ก.ค. 21
3900