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?
;)
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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
相关帖文 | 回复 | 查看 | 活动 | |
---|---|---|---|---|
|
1
7月 23
|
2748 | ||
|
2
8月 15
|
10327 | ||
|
0
5月 15
|
3999 | ||
|
0
4月 15
|
4474 | ||
|
0
9月 23
|
5134 |
from odoo.addons.[MODULE].[FILE] import [var1], [var2]