Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odgovori
7931 Prikazi

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
Opusti
Avtor

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
Opusti
Related Posts Odgovori Prikazi Aktivnost
1
jul. 23
3076
2
avg. 15
10650
0
maj 15
4267
0
apr. 15
4751
0
sep. 23
5382