Odoo Help


Users creation

ahmad safi
on 11/2/16, 6:58 AM 343 views

I want to define number of user can admin create ex: admin can create only 5 users 

if its impossible i want to define rule to create number of records in any table 

please i neeeed help


Ahmad safi,

You create a model having 2 fields  user_id(Many2one, unique) and user_creation_limit(integer).

That may have tree view and form view.

Then override the create method of res.users

def create(self, vals):
    # Calculate this user is eligible to create
    # using self._uid
    # by fetching list of all users and their created user id(create_uid )
    if eligible:
        return super(ModelName, self).create(vals)
        raise UserError(_('Your limit is exceed'))



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/2/16, 6:58 AM
Seen: 343 times
Last updated: 11/2/16, 7:24 AM