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?
;)
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?
;)
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
Opret en konto i dag for at få glæde af eksklusive funktioner, og bliv en del af vores skønne fællesskab!
Tilmeld dig| Relaterede indlæg | Besvarelser | Visninger | Aktivitet | |
|---|---|---|---|---|
|
1
jul. 23
|
5190 | |||
|
2
aug. 15
|
12269 | |||
|
0
maj 15
|
5938 | |||
|
0
apr. 15
|
6290 | |||
|
0
sep. 23
|
7127 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.
from odoo.addons.[MODULE].[FILE] import [var1], [var2]