From c849e012803eb5bed1e8c3f3449bcb7b37daf0ef Mon Sep 17 00:00:00 2001 From: houssine Date: Thu, 25 Jan 2018 14:31:30 +0100 Subject: [PATCH] [IMP] if the partner tied to the connected user is a company the request is forwarded to the company subscription form --- easy_my_coop/controllers/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/easy_my_coop/controllers/main.py b/easy_my_coop/controllers/main.py index 3415d25..9937c7f 100644 --- a/easy_my_coop/controllers/main.py +++ b/easy_my_coop/controllers/main.py @@ -18,7 +18,10 @@ class WebsiteSubscription(http.Controller): @http.route(['/page/become_cooperator','/become_cooperator'], type='http', auth="public", website=True) def display_become_cooperator_page(self, **kwargs): values = {} - + if request.env.user.login != 'public': + partner = request.env.user.partner_id + if partner.is_company: + return request.website.render("easy_my_coop.becomecompanycooperator", values) values = self.fill_values(values,False,True) for field in ['email','firstname','lastname','birthdate','iban','share_product_id','no_registre','address','city','zip_code','country_id','phone','lang','nb_parts','total_parts','error_msg']: