콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
7832 화면

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?


;)

아바타
취소
작성자

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

베스트 답변

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
2890
2
8월 15
10517
0
5월 15
4144
0
4월 15
4601
0
9월 23
5235