Created
April 23, 2018 14:55
-
-
Save tienhieuD/cbbac15609cb5af1902edf28774cd519 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@api.model | |
def create_user(self, name, email, pwd): | |
info = { 'name': name, | |
'login': email, | |
'password': pwd,} | |
try: | |
self.env['res.users'].sudo().create(info) | |
return True | |
except: | |
return False | |
@api.model | |
def create(self, values): | |
name = values.get('ten_hoc_vien') | |
email = values.get('email') | |
pwd = values.get('mat_khau') | |
self.create_user(name, email, pwd): | |
return super(hocsinh, self).create(values) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment