Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
7674 Vizualizări

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?


;)

Imagine profil
Abandonează
Autor

from odoo.addons.[MODULE].[FILE] import [var1], [var2]

Cel mai bun răspuns

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

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
iul. 23
2738
2
aug. 15
10314
0
mai 15
3995
0
apr. 15
4465
0
sept. 23
5129