跳至內容
選單
此問題已被標幟
1 回覆
5300 瀏覽次數

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

相關帖文 回覆 瀏覽次數 活動
1
4月 15
14242
0
3月 15
3195
2
10月 15
6693
1
3月 15
7687
3
3月 15
5042