Browse Source

[FIX] put code block to create user and send email invitation in the if

statement where it belongs
pull/1/head
houssine 7 years ago
parent
commit
59caa08fd3
  1. 7
      easy_my_coop/models/coop.py

7
easy_my_coop/models/coop.py

@ -270,10 +270,11 @@ class subscription_request(models.Model):
user = user_obj.search([('login','=',email)])
if not user:
user_values = {'partner_id': partner.id,'login':email}
user_id = user_obj.sudo()._signup_create_user(user_values)
user = user_obj.browse(user_id)
user.sudo().with_context({'create_user': True}).action_reset_password()
user_id = user_obj.sudo()._signup_create_user(user_values)
user = user_obj.browse(user_id)
user.sudo().with_context({'create_user': True}).action_reset_password()
return True
@api.one
def validate_subscription_request(self):

Loading…
Cancel
Save