Merge branch 'imp/13.0/website_sale_payment_terms__refactor_js' into '13.0-test'

imp/13.0/website_sale_payment_terms__refactor_js into 13.0-test

See merge request hibou-io/hibou-odoo/suite!1070
This commit is contained in:
Hibou Bot
2021-09-28 19:37:17 +00:00

View File

@@ -137,14 +137,17 @@ odoo.define('website_sale_payment_terms.payment_terms', function (require) {
* @private
*/
_acceptPaymentTerms: function () {
$('#o_payment_form_pay').prop('disabled', false);
var $payButton = $('#o_payment_form_pay');
var disabledReasons = $payButton.data('disabled_reasons') || {};
disabledReasons.payment_terms_selection = false;
$payButton.data('disabled_reasons', disabledReasons);
$payButton.prop('disabled', _.contains($payButton.data('disabled_reasons'), true));
},
/*
* @private
*/
_denyPaymentTerms: function () {
$('#o_payment_form_pay').prop('disabled', true);
window.location = '/shop/reject_term_agreement';
},
});