my function is defined in the website controller and I wish to call it from a model, e.g (res.partner)
คำถามนี้ถูกตั้งค่าสถานะ
1
ตอบกลับ
9503
มุมมอง
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
|
4494 | ||
|
|
1
ส.ค. 15
|
5290 | ||
|
|
2
ธ.ค. 21
|
26280 | ||
|
Get model data in a controller
แก้ไขแล้ว
|
|
4
ต.ค. 21
|
40446 | |
|
|
1
ก.ค. 21
|
5769 |