diff --git a/addons/website_sale_options/static/src/js/website_sale.js b/addons/website_sale_options/static/src/js/website_sale.js index 1916c150..8b9a312e 100644 --- a/addons/website_sale_options/static/src/js/website_sale.js +++ b/addons/website_sale_options/static/src/js/website_sale.js @@ -9,7 +9,7 @@ require('website_sale.website_sale'); $('.oe_website_sale #add_to_cart, .oe_website_sale #products_grid .a-submit') .off('click') .removeClass('a-submit') - .click(function (event) { + .click(_.debounce(function (event) { var $form = $(this).closest('form'); var quantity = parseFloat($form.find('input[name="add_qty"]').val() || 1); var product_id = parseInt($form.find('input[type="hidden"][name="product_id"], input[type="radio"][name="product_id"]:checked').first().val(),10); @@ -96,6 +96,6 @@ $('.oe_website_sale #add_to_cart, .oe_website_sale #products_grid .a-submit') }); }); return false; - }); + }, 200, true)); });