Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
7951 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
2695
1
thg 8 15
3896
2
thg 12 21
24535
4
thg 10 21
37716
1
thg 7 21
4232