summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2018-05-30 16:27:49 +0200
committerNicolas Lempereur <nle@odoo.com>2018-06-04 10:20:27 +0200
commit57a64bbc8686d96d97015e5fb0c14aa427286114 (patch)
treeee0022e3c4b67b9ce02b3fe1652eced5b0940cf4 /addons
parentd88dd23ae2e6dada4bd81a1383b45d3a4b8c4abf (diff)
[FIX] website_event: unblock button when no reserve
In 11.0, this change e9454e79 solved the use case of: - opening the registration of a ticket - discard => the page must be reloaded to register a ticket A new report is that since 9.0, if we try to register 0 ticket we would also have to reload the page. This commit backports e9454e79 and solves the 0 ticket registration. 10.0 version of 9.0's #24966 opw-1851622 closes #24991
Diffstat (limited to 'addons')
-rw-r--r--addons/website_event/static/src/js/website_event.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/addons/website_event/static/src/js/website_event.js b/addons/website_event/static/src/js/website_event.js
index 2038494a3e5..81192b03e0f 100644
--- a/addons/website_event/static/src/js/website_event.js
+++ b/addons/website_event/static/src/js/website_event.js
@@ -23,16 +23,23 @@ var EventRegistrationForm = Widget.extend({
ev.preventDefault();
ev.stopPropagation();
var $form = $(ev.currentTarget).closest('form');
+ var $button = $(ev.currentTarget).closest('[type="submit"]');
var post = {};
$("#registration_form select").each(function() {
post[$(this).attr('name')] = $(this).val();
});
return ajax.jsonRpc($form.attr('action'), 'call', post).then(function (modal) {
+ // Only needed for 9.0 up to saas-14
+ if (modal === false) {
+ $button.prop('disabled', false);
+ return;
+ }
var $modal = $(modal);
$modal.find('.modal-body > div').removeClass('container'); // retrocompatibility - REMOVE ME in master / saas-19
- $modal.after($form).modal();
+ $modal.insertAfter($form).modal();
$modal.on('click', '.js_goto_event', function () {
$modal.modal('hide');
+ $button.prop('disabled', false);
});
});
},