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

Hi,

I need to stop my customers to create only 2 users in their database how can i restrict this in odoo.

Any one Could you help me..

Thanks in Advance.....

Аватар
Отменить
Лучший ответ

Hi,

you can put constraints on the res.users model as like below.

_constraints = [  (_check_no, 'You cannot create more then 2 users .... ! ! ! !', []) ]

def _check_no(self, cr, uid, ids, context={}):

    user_ids = self.search(cr, uid, [] )

    if len(user_ids) > 2:

        return False

    return True

I hope it will help to achieve your goal.

 

Аватар
Отменить
Автор

thank you very much for your answer Emipro technologies

Related Posts Ответы Просмотры Активность
1
апр. 15
14182
0
мар. 15
3177
2
окт. 15
6661
1
мар. 15
7585
3
мар. 15
5003