Se rendre au contenu
Menu
Cette question a été signalée
2 Réponses
7676 Vues

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
Ignorer
Auteur

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

Meilleure réponse

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
Ignorer
Publications associées Réponses Vues Activité
1
juil. 23
2739
2
août 15
10316
0
mai 15
3995
0
avr. 15
4467
0
sept. 23
5129