Skip to Content
Menu
This question has been flagged
1 Odpoveď
7972 Zobrazenia

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

Avatar
Zrušiť
Best Answer

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.

Avatar
Zrušiť
Related Posts Replies Zobrazenia Aktivita
2
júl 24
2717
1
aug 15
3910
2
dec 21
24547
4
okt 21
37746
1
júl 21
4258