From 612b705975227ee3e482ce14db0e5b4f9f0906ec Mon Sep 17 00:00:00 2001 From: "Achraf (abz)" Date: Thu, 18 Nov 2021 07:25:15 +0000 Subject: [PATCH] [FIX] stock: Don't try to load reports from unselected companies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If we have two companies A and B with B selected and we try to access the Forecast Report via a product, company A's warehouse is automatically selected, which of course creates a security error. This fix modifies the ´get_warehouses´ method in order to return only the warehouses whose company is selected. opw-2688135 closes odoo/odoo#80021 X-original-commit: 088e97aa3214578de99abbd47bd6aeccff244855 Signed-off-by: William Henrotin (whe) Signed-off-by: Achraf --- addons/stock/static/src/js/report_stock_forecasted.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/stock/static/src/js/report_stock_forecasted.js b/addons/stock/static/src/js/report_stock_forecasted.js index 4258c6c027d..61c0f41c415 100644 --- a/addons/stock/static/src/js/report_stock_forecasted.js +++ b/addons/stock/static/src/js/report_stock_forecasted.js @@ -35,6 +35,7 @@ const ReplenishReport = clientAction.extend({ var loadWarehouses = this._rpc({ model: 'report.stock.report_product_product_replenishment', method: 'get_warehouses', + context: this.context, }).then((res) => { this.warehouses = res; if (this.context.warehouse) {