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

Hi
How can i get  Currently active company ids in Odoo 13 (case of multi company we can select multiple companies from the company list, right).



So how can i get these selected company ids in a function.

아바타
취소
베스트 답변

Hi 

You can get selected compay_id form the context.

selected_companies = self.env['res.company'].browse(self._context.get('allowed_company_ids'))
아바타
취소
베스트 답변

def _get_my_default_company(self):
      company_ids = self.env.user.company_id.id

you can then use the ids to retrieve any information from the res.company table

    
아바타
취소