Skip to Content
Menu
This question has been flagged
2 Replies
7579 Views

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
Discard
Author

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

Best Answer

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
Discard
Related Posts Replies Views Activity
1
Jul 23
2549
2
Aug 15
10219
0
May 15
3916
0
Apr 15
4363
0
Sep 23
5054