Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
7771 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 7 24
2538
1
thg 8 15
3769
2
thg 12 21
24374
4
thg 10 21
37534
1
thg 7 21
4102