Browse Source

[IMP] make the upload file required when it's displayed

pull/1/head
houssine 6 years ago
parent
commit
7cdbb30df6
  1. 4
      easy_my_coop/controllers/main.py

4
easy_my_coop/controllers/main.py

@ -232,7 +232,10 @@ class WebsiteSubscription(http.Controller):
return request.website.render(redirect, values) return request.website.render(redirect, values)
# Check that required field from model subscription_request exists # Check that required field from model subscription_request exists
company = request.website.company_id
required_fields = request.env['subscription.request'].sudo().get_required_field() required_fields = request.env['subscription.request'].sudo().get_required_field()
if company.allow_id_card_upload:
required_fields.append('file')
error = set(field for field in required_fields if not values.get(field)) error = set(field for field in required_fields if not values.get(field))
if error: if error:
@ -259,7 +262,6 @@ class WebsiteSubscription(http.Controller):
values["share_product_id"] = product.id values["share_product_id"] = product.id
# check the subscription's amount # check the subscription's amount
company = request.website.company_id
max_amount = company.subscription_maximum_amount max_amount = company.subscription_maximum_amount
total_amount = float(kwargs.get('total_parts')) total_amount = float(kwargs.get('total_parts'))

Loading…
Cancel
Save