Browse Source

[IMP] in case of a user has previously been created and deactivated

pull/1/head
houssine 6 years ago
parent
commit
813ec8a6b6
  1. 5
      easy_my_coop/models/account_invoice.py

5
easy_my_coop/models/account_invoice.py

@ -30,6 +30,11 @@ class account_invoice(models.Model):
user = user_obj.search([('login', '=', email)])
if not user:
user = user_obj.search([('login', '=', email),
('active', '=', False)])
if user:
user.sudo().write({'active': True})
else:
user_values = {'partner_id': partner.id, 'login': email}
user_id = user_obj.sudo()._signup_create_user(user_values)
user = user_obj.browse(user_id)

Loading…
Cancel
Save