From 2c49e56d30b46e761a7e292c08f3f332d85aeda4 Mon Sep 17 00:00:00 2001 From: svs-odoo Date: Fri, 11 Dec 2020 15:25:05 +0000 Subject: [PATCH] [FIX] stock: click on forecast widget Before this commit, once a field has the 'forecast_widget', the user is redirect to the forecast report also when they clicks on the field. How to reproduce: - Creates/Opens a delivery; - In Operations list, clicks on the reserved qty. field of one of the line -> It opens the forecast report. The wanted behaviour is the user is redirected to the report only if they clicks on the widget's button, not on the field itself. task-2415918 closes odoo/odoo#64575 X-original-commit: 22a2845909c6cf96536aa4e664fca5d1ff3fb589 Signed-off-by: William Henrotin Signed-off-by: Steve Van Essche --- addons/stock/static/src/js/forecast_widget.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/static/src/js/forecast_widget.js b/addons/stock/static/src/js/forecast_widget.js index d6d848f2566..c7bb19f9878 100644 --- a/addons/stock/static/src/js/forecast_widget.js +++ b/addons/stock/static/src/js/forecast_widget.js @@ -34,7 +34,7 @@ const ForecastWidgetField = AbstractField.extend({ data.will_be_fulfilled = utils.round_decimals(data.forecast_availability, this.record.fields.forecast_availability.digits[1]) >= utils.round_decimals(data.product_qty, this.record.fields.product_qty.digits[1]); this.$el.html(QWeb.render('stock.forecastWidget', data)); - this.$el.on('click', this._onOpenReport.bind(this)); + this.$('.o_forecast_report_button').on('click', this._onOpenReport.bind(this)); }, isSet: function () {