Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
5314 Visualizzazioni

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

Avatar
Abbandona
Risposta migliore

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.

 

Avatar
Abbandona
Autore

thank you very much for your answer Emipro technologies

Post correlati Risposte Visualizzazioni Attività
1
apr 15
14256
0
mar 15
3210
2
ott 15
6706
1
mar 15
7730
3
mar 15
5048