From 23ecf40cedf85534fe0470a768766b774e56f6e7 Mon Sep 17 00:00:00 2001 From: Turkesh Patel Date: Mon, 7 Aug 2023 10:58:52 +0200 Subject: [PATCH] [FW][FIX] website_sale_stock_wishlist: product not found In the wishlist, if a product has no stock available, the customer can request to be notified when the product is "back in stock". If a barcode is configured on the product, the request will fail with a "Missing record" error. Indeed, the code relied on the tracking info (google analytics data) to find the product id. This is a mistake since the barcode is given as `item_id` in the tracking info if set (instead of the product id). Since the product id information is already available as node data, use this mean to get the right product id directly. Fixes #130471 closes odoo/odoo#130949 Forward-port-of: odoo/odoo#130473 Signed-off-by: Victor Feyens (vfe) --- .../website_sale_stock_wishlist/static/src/js/website_sale.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_sale_stock_wishlist/static/src/js/website_sale.js b/addons/website_sale_stock_wishlist/static/src/js/website_sale.js index 0e355359e6b..4af6032f2f1 100644 --- a/addons/website_sale_stock_wishlist/static/src/js/website_sale.js +++ b/addons/website_sale_stock_wishlist/static/src/js/website_sale.js @@ -14,7 +14,7 @@ WebsiteSale.include({ }, _onClickSubmitWishlistStockNotificationForm(ev) { - const productId = JSON.parse(ev.currentTarget.closest('tr').dataset.productTrackingInfo).item_id; + const productId = ev.currentTarget.closest('tr').dataset.productId; this._handleClickSubmitStockNotificationForm(ev, productId); }, });