تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
2073 أدوات العرض

Hey all,

i'm trying to get the currently selected company in a multi-company environment.

I've tried using 

self.env.user.company_id

But this gives me the user's default company.

I've also tried using the _context to get allowed_company_ids but this gives me a list that I can't use


Any help?

الصورة الرمزية
إهمال

Does not work can you share with model code for example?

أفضل إجابة

Hi,

You can get the currently selected company in a multi-company environment by self.env.context.get('allowed_company_ids')

Hope it helps


الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
سبتمبر 25
2041
1
أغسطس 25
1656
1
أغسطس 25
636
0
يوليو 25
759
0
يوليو 25
1319