From 96c2716674750084c4dea5ffc35b81841b23fc7a Mon Sep 17 00:00:00 2001 From: "Hubert Van de Walle (huvw)" Date: Wed, 20 Jul 2022 12:41:56 +0000 Subject: [PATCH] [FIX] stock: history back on the forecast report Steps to reproduce: - Go to stock > Replenishment - Click on a forecast report widget - Go back using the browser arrows -> The page is redirected to another forecast report and the breadcrumbs are cleared Cause of the issue: The forecast report action uses the `window.history.pushState` to add the active model in the url. When going back, the new url is the same one but without the active model. We can get the correct behavior by doing `window.history.go(-2)` in the console. Solution: Use `history.replaceState` instead opw-2917725 closes odoo/odoo#96487 X-original-commit: b39dc5488bacb704aaa60f1a502bf005d57f3276 Signed-off-by: Steve Van Essche Signed-off-by: Hubert Van De Walle --- addons/stock/static/src/js/report_stock_forecasted.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/static/src/js/report_stock_forecasted.js b/addons/stock/static/src/js/report_stock_forecasted.js index 9da062a5d76..45cb79873ae 100644 --- a/addons/stock/static/src/js/report_stock_forecasted.js +++ b/addons/stock/static/src/js/report_stock_forecasted.js @@ -101,7 +101,7 @@ const ReplenishReport = clientAction.extend({ // Hack to put the res_model on the url. This way, the report always know on with res_model it refers. if (location.href.indexOf('active_model') === -1) { const url = window.location.href + `&active_model=${this.resModel}`; - window.history.pushState({}, "", url); + window.history.replaceState({}, "", url); } },