Browse Source

[FIX] fix redirection when cooperator is a company

pull/11/head
houssine 5 years ago
parent
commit
aa405ce451
  1. 9
      easy_my_coop/controllers/main.py

9
easy_my_coop/controllers/main.py

@ -38,7 +38,7 @@ class WebsiteSubscription(http.Controller):
logged = True logged = True
partner = request.env.user.partner_id partner = request.env.user.partner_id
if partner.is_company: if partner.is_company:
return request.website.render("easy_my_coop.becomecompanycooperator", values)
return self.display_become_company_cooperator_page()
values = self.fill_values(values, False, logged, True) values = self.fill_values(values, False, logged, True)
for field in _COOP_FORM_FIELD: for field in _COOP_FORM_FIELD:
@ -103,7 +103,7 @@ class WebsiteSubscription(http.Controller):
values['company_register_number'] = partner.company_register_number values['company_register_number'] = partner.company_register_number
values['company_name'] = partner.name values['company_name'] = partner.name
values['company_email'] = partner.email values['company_email'] = partner.email
values['company_email'] = partner.legal_form
values['company_type'] = partner.legal_form
# contact person values # contact person values
representative = partner.get_representative() representative = partner.get_representative()
values['firstname'] = representative.firstname values['firstname'] = representative.firstname
@ -119,7 +119,6 @@ class WebsiteSubscription(http.Controller):
values['lastname'] = partner.lastname values['lastname'] = partner.lastname
values['email'] = partner.email values['email'] = partner.email
values['gender'] = partner.gender values['gender'] = partner.gender
values['function'] = partner.function
values['birthdate'] = self.get_date_string(partner.birthdate) values['birthdate'] = self.get_date_string(partner.birthdate)
values['lang'] = partner.lang values['lang'] = partner.lang
values['phone'] = partner.phone values['phone'] = partner.phone
@ -358,9 +357,9 @@ class WebsiteSubscription(http.Controller):
values["share_product_id"] = self.get_selected_share(kwargs).id values["share_product_id"] = self.get_selected_share(kwargs).id
if is_company: if is_company:
values['company_type'] = kwargs.get("company_type")
if kwargs.get("company_register_number", False): if kwargs.get("company_register_number", False):
values["company_register_number"] = re.sub('[^0-9a-zA-Z]+',
'',
values["company_register_number"] = re.sub('[^0-9a-zA-Z]+', '',
kwargs.get("company_register_number")) kwargs.get("company_register_number"))
subscription_id = sub_req_obj.sudo().create_comp_sub_req(values) subscription_id = sub_req_obj.sudo().create_comp_sub_req(values)
else: else:

Loading…
Cancel
Save