Browse Source

[IMP] if the loaner info are not complete we redirect him to his account

pull/134/head
houssine 4 years ago
parent
commit
f0a74f60c2
  1. 11
      easy_my_coop_loan_website/__manifest__.py
  2. 20
      easy_my_coop_loan_website/controllers/main.py
  3. 6
      easy_my_coop_website/__manifest__.py

11
easy_my_coop_loan_website/__manifest__.py

@ -5,7 +5,11 @@
{
"name": "Easy My Coop Loan Issues Website",
"version": "12.0.1.0.1",
"depends": ["easy_my_coop_loan", "easy_my_coop_website", "website"],
"depends": [
"easy_my_coop_loan",
"easy_my_coop_website",
"website",
],
"author": "Coop IT Easy SCRLfs",
"category": "Cooperative management",
"website": "http://www.coopiteasy.be",
@ -14,6 +18,9 @@
This module implements the subscription page
for bonds and subordinated loans.
""",
"data": ["data/website_loan_data.xml", "template/loan_issue_template.xml"],
"data": [
"data/website_loan_data.xml",
"template/loan_issue_template.xml"
],
"installable": True,
}

20
easy_my_coop_loan_website/controllers/main.py

@ -26,6 +26,21 @@ class WebsiteLoanIssueSubscription(http.Controller):
else:
return False
def missing_mandatory_info(self):
partner = request.env.user.partner_id
if (
not partner.bank_ids
or not partner.birthdate_date
or not partner.street
or not partner.city
or not partner.zip
or not partner.country_id
or not partner.gender
or not partner.phone
):
return False
return True
@http.route(
["/subscription/loan_issue_form"],
type="http",
@ -34,8 +49,9 @@ class WebsiteLoanIssueSubscription(http.Controller):
)
def display_loan_issue_subscription_page(self, **kwargs):
values = {}
partner = request.env.user.partner_id
is_company = partner.is_company
if not self.missing_mandatory_info():
return request.redirect("/my/account")
is_company = request.env.user.partner_id.is_company
values = self.fill_values(values, is_company)
values.update(kwargs=kwargs.items())

6
easy_my_coop_website/__manifest__.py

@ -6,7 +6,11 @@
{
"name": "Easy My Coop Website",
"version": "12.0.1.0.4",
"depends": ["easy_my_coop", "website", "website_recaptcha_reloaded"],
"depends": [
"easy_my_coop",
"website",
"website_recaptcha_reloaded",
],
"author": "Coop IT Easy SCRLfs",
"category": "Cooperative management",
"website": "https://coopiteasy.be",

Loading…
Cancel
Save