Skip to content

Instantly share code, notes, and snippets.

@tienhieuD
Created July 28, 2017 10:02
Show Gist options
  • Save tienhieuD/268843154075b3e7312817ddd341f213 to your computer and use it in GitHub Desktop.
Save tienhieuD/268843154075b3e7312817ddd341f213 to your computer and use it in GitHub Desktop.
@api.model
def create(self, values):
quyen_da_chon = values['quyen'][0][2]
quyen_da_chon.append(1)
vals = {
'name': values['login'],
'login': values['login'],
'new_password': '7777777',
'company_ids': [1],
'company_id': 1,
'groups_id': quyen_da_chon,
}
# print values
# print vals
self.env['res.users'].sudo().create(vals)
user = super(Users, self).create(values)
return user
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment