Skip to Content
Menu
This question has been flagged
2 Replies
3887 Rodiniai

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


Portretas
Atmesti
Autorius Best Answer

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

Portretas
Atmesti
Best Answer
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.
Portretas
Atmesti
Autorius

HI Kripal,

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

Related Posts Replies Rodiniai Veikla
0
lapkr. 20
3842
1
kov. 15
4688
4
spal. 24
4032
0
geg. 23
1854
1
bal. 21
2782