Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
3821 Представления

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.

Related Posts Ответы Просмотры Активность
0
нояб. 20
3803
1
мар. 15
4628
4
окт. 24
3993
0
мая 23
1776
1
апр. 21
2706