Skip to Content
Menú
This question has been flagged
2 Respostes
7919 Vistes

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]

Best Answer

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
Related Posts Respostes Vistes Activitat
1
de jul. 23
3069
2
d’ag. 15
10643
0
de maig 15
4266
0
d’abr. 15
4748
0
de set. 23
5377