summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJorge Pinna Puissant <jpp@odoo.com>2021-02-15 11:41:23 +0000
committerJorge Pinna Puissant <jpp@odoo.com>2021-02-15 12:57:35 +0000
commit768bcf58e8dc215b96b11bafa632c07dc683e297 (patch)
tree18182739c8adf1cc7b50eacd0b3b2629c0547f41
parent79ac2d229deca4f63f8096b6e6ea0a9dd73695f3 (diff)
[FIX] event_sale: traceback raised when product have blocking message
- Install event_sale; - On the Sale's settings check 'Sale Warning'; - Create a blocking message for a product; - Create a SO; - Add the product with the blocking message. Before this commit, a traceback was raised before the blocking message is shown. Now, only the blocking message is shown. opw-2458568 closes odoo/odoo#66159 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
-rw-r--r--addons/event_sale/static/src/js/event_configurator_widget.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/event_sale/static/src/js/event_configurator_widget.js b/addons/event_sale/static/src/js/event_configurator_widget.js
index 5bbdb3e7033..eff0edd3a99 100644
--- a/addons/event_sale/static/src/js/event_configurator_widget.js
+++ b/addons/event_sale/static/src/js/event_configurator_widget.js
@@ -32,7 +32,7 @@ ProductConfiguratorWidget.include({
_onProductChange: function (productId, dataPointId) {
var self = this;
return this._super.apply(this, arguments).then(function (stopPropagation) {
- if (stopPropagation) {
+ if (stopPropagation || productId === undefined) {
return Promise.resolve(true);
} else {
return self._checkForEvent(productId, dataPointId);
@@ -56,7 +56,7 @@ ProductConfiguratorWidget.include({
method: 'read',
args: [productId, ['event_ok']],
}).then(function (result) {
- if (result && result[0].event_ok) {
+ if (Array.isArray(result) && result.length && result[0].event_ok) {
self._openEventConfigurator({
default_product_id: productId
},