From decfd753f968cbea8b2955562b7774e88ac7d637 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 12 Aug 2020 08:03:22 +0000 Subject: [PATCH] [FIX] payment: Pay button always enabled with Term & Conditions Steps to reproduce: - Go to the website shop - Add a product in the cart - Add your address and click on checkout - On the checkout, enable Terms & conditions Bug: The button was always enabled even if the check box with the terms & conditions were not checked. opw:2313437 closes odoo/odoo#55821 X-original-commit: 0415da51960819ec9c989e15a9229bd6d583ba1b Signed-off-by: Simon Goffin (sig) --- addons/payment/static/src/js/payment_form.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/payment/static/src/js/payment_form.js b/addons/payment/static/src/js/payment_form.js index 90f1a4843c5..67ac150e10a 100644 --- a/addons/payment/static/src/js/payment_form.js +++ b/addons/payment/static/src/js/payment_form.js @@ -22,7 +22,9 @@ publicWidget.registry.PaymentForm = publicWidget.Widget.extend({ * @override */ start: function () { - $("#o_payment_form_pay").removeAttr('disabled'); + if(!$('#checkbox_cgv').length){ + $("#o_payment_form_pay").removeAttr('disabled'); + } var self = this; return this._super.apply(this, arguments).then(function () { self.options = _.extend(self.$el.data(), self.options);