my function is defined in the website controller and I wish to call it from a model, e.g (res.partner)
Tämä kysymys on merkitty
1
Vastaa
9490
Näkymä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.
Nautitko keskustelusta? Älä vain lue, vaan osallistu!
Luo tili jo tänään nauttiaksesi yksinoikeusominaisuuksista ja osallistuaksesi mahtavaan yhteisöömme!
Rekisteröidy| Aiheeseen liittyviä artikkeleita | Vastaukset | Näkymät | Toimenpide | |
|---|---|---|---|---|
|
|
2
heinäk. 24
|
4485 | ||
|
|
1
elok. 15
|
5287 | ||
|
|
2
jouluk. 21
|
26275 | ||
|
Get model data in a controller
Ratkaistu
|
|
4
lokak. 21
|
40433 | |
|
|
1
heinäk. 21
|
5752 |