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
|
3817 | |||
|
2
8월 15
|
11353 | |||
|
0
5월 15
|
4891 | |||
|
0
4월 15
|
5387 | |||
|
0
9월 23
|
5970 |
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]