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
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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
Same question asked by Ahmad safi
I answered him following
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
@api.model
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)
else:
raise UserError(_('Your limit is exceed'))
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up