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

    def check_credentials(self, cr, uid, password):
        """ Override this method to plug additional authentication methods"""
        res = self.search(cr, SUPERUSER_ID, [('id','=',uid),('password','=',password)])
        print "ppppppppppppppppppppppppppppppppppppppppppppppppppp",res
        if not res:
            raise openerp.exceptions.AccessDenied()

please let me know to how to solve this.

it is returning blank list =  ppppppppppppppppppppppppppppppppppppppppppppppppppp []

頭像
捨棄
最佳答案

Hello Apoorv Soral,


If you want to override res.users method then You need to used super method for this.

For Ex:


class res_users(osv.osv):
    _inherit = "res.users"

     

     def check_credentials(self, cr, uid, password):
         res = super(res_users, self).check_credentials(cr, uid, password)  //For Override existing method
         print "res ========= ", res
         user_id = self.search(cr, SUPERUSER_ID, [('id','=',uid),('password','=',password)])
         print "user_id !!!!!!! ", user_id

         if user_id:

             return user_id

         else:

             return res


Hope this will helps you.

Thanks,

     

頭像
捨棄
作者

Hi Jignesh,

I have also try in this way but it is returning blank list : []

相關帖文 回覆 瀏覽次數 活動
1
3月 17
9940
0
4月 15
4501
7
10月 24
7665
1
9月 24
1300
1
4月 24
1883