Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
7681 Visualizzazioni

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
Abbandona
Autore

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

Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
lug 23
2744
2
ago 15
10323
0
mag 15
3997
0
apr 15
4468
0
set 23
5131