Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
7703 Vistas

How do I get to use a constant defined in some other module?


Suppose I want to use XPTO defined in hr_timesheet module.

The value is a constant. It's not within a class


How do I refer to it in my own module?


;)

Avatar
Descartar
Autor

from odoo.addons.[MODULE].[FILE] import [var1], [var2]

Mejor respuesta

Hi Rui Franco,

Try below code in a python file of your module:

 from odoo.addons.hr_timesheet.models.[file name] import XPTO

 This will import XPTO variable of hr_timesheet module into your file

Hope this will help you!

Thanks

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
jul 23
2766
2
ago 15
10359
0
may 15
4013
0
abr 15
4491
0
sept 23
5152