콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
3 답글
8565 화면

Getting this error on the last line. I am not sure what to pass in the first argument...


File "/custom_modules/res_users_login_lowercase/res_users.py", line 16, in _login

    return super(Users, cls)._login(cls, db, login, password)

TypeError: unbound method _login() must be called with res.users instance as first argument (got MetaModel instance instead)


-----------------CODE BELOW-------------

08 from openerp import models, api, fields class Users(models.Model):

09    _inherit = 'res.users'

10     login = fields.Char(help='Used to log into the system. Case insensitive.',)

11 

12    @classmethod

13    def _login(cls, db, login, password):

14       """ Overload _login to lowercase the `login` before passing to the super """

15       login = login.lower()

16       return super(Users, cls)._login(cls, db, login, password)


---------------------------------------------


아바타
취소
베스트 답변

Dear grayson,

try to add self parameter like this:

def _login(self,cls, db, login, password):
I hope I helped you...
아바타
취소
작성자

thank you for the response, I will give that a try.

관련 게시물 답글 화면 활동
1
3월 15
3704
Cannot log in 해결 완료
3
3월 15
4309
3
8월 24
1359
2
6월 24
1407
2
5월 24
1956