Browse Source

[FIX] avoid error when share_product_id is False (not share displayed)

12.0-max-amount-per-share
houssine 5 years ago
parent
commit
51e619042c
  1. 3
      easy_my_coop_website/controllers/main.py

3
easy_my_coop_website/controllers/main.py

@ -302,6 +302,7 @@ class WebsiteSubscription(http.Controller):
methods=['POST'], website=True)
def get_share_product(self, share_product_id, **kw):
product_template = request.env['product.template']
if share_product_id:
product = product_template.sudo().browse(int(share_product_id))
return {
product.id: {
@ -310,6 +311,8 @@ class WebsiteSubscription(http.Controller):
'force_min_qty': product.force_min_qty
}
}
else:
return False
@http.route(['/subscription/subscribe_share'],
type='http',

Loading…
Cancel
Save