Se rendre au contenu
Menu
Cette question a été signalée
2 Réponses
3849 Vues

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


Avatar
Ignorer
Auteur Meilleure réponse

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

Avatar
Ignorer
Meilleure réponse
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.
Avatar
Ignorer
Auteur

HI Kripal,

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

Publications associées Réponses Vues Activité
0
nov. 20
3819
1
mars 15
4664
4
oct. 24
4010
0
mai 23
1802
1
avr. 21
2731