跳至內容
選單
此問題已被標幟
2 回覆
3856 瀏覽次數

Hi Guys,

I tried to check the multi-company is enabled or not. But it returning empty records.

Can anyone help me to find whether the multi-company is enabled or not?

Note: Without creating any additional records

Code Snippet

multi_company = self.env['res.config.settings'].sudo().search([])

Tried Snippet

multi_company = self.env['ir.config_parameter'].sudo().get_param('group_multi_company')

Thanks in Advance


頭像
捨棄
作者 最佳答案

Hi Everyone,

Got a solution by using the below code

multi_company = self.env['res.users'].has_group('base.group_multi_company')

Thank You All

頭像
捨棄
最佳答案
multi_company = self.env['res.config.settings'].sudo().search([])
print(multi_company.group_multi_company)

If multi_company.group_multi_company is True => Multi-Company is enabled, if False, disabled.
頭像
捨棄
作者

HI Kripal,

Thanks for your answer. But it's not working and the same code added in my description.

相關帖文 回覆 瀏覽次數 活動
0
11月 20
3821
1
3月 15
4669
4
10月 24
4015
0
5月 23
1810
1
4月 21
2735