Odoo Help


How to stop or restrict creating more than 2 users in odoo?

on 11/19/14, 12:27 AM 1,273 views


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.....



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

on 11/20/14, 5:12 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 11/19/14, 12:27 AM
Seen: 1273 times
Last updated: 4/8/15, 1:34 AM