Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
5281 มุมมอง

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
14218
0
มี.ค. 15
3183
Can someone explain me the xpath? แก้ไขแล้ว
2
ต.ค. 15
6686
1
มี.ค. 15
7602
3
มี.ค. 15
5032