From 2f3978bab7f8ce43cd5e6859cf73d6c7c885ab85 Mon Sep 17 00:00:00 2001 From: nouraellm Date: Tue, 2 Mar 2021 13:55:51 +0000 Subject: [PATCH] [FIX] mrp: fix reserved_qty precision issue with forecast availability Description of the issue/feature this PR addresses: - Fix tends to fix reserved_qty if the precision of product_uom_qty is higher than 0.5 Current behavior before PR: - If the precision of product_uom_qty is higher than 0.5 reserved_qty (components availability) appears to be not available although there is enough qty in the stock. Desired behavior after PR is merged: - Unless there's no enough qty in the stock, reserved_qty is available. opw-2425473 opw-2459650 opw-2448443 opw-2446985 opw-2440853 opw-2464507 closes odoo/odoo#67116 X-original-commit: e406e7b2512b52bd45c9c825981678cd2bbd3128 Signed-off-by: Arnold Moyaux --- 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 c7bb19f9878..b1c4dc31cfd 100644 --- a/addons/stock/static/src/js/forecast_widget.js +++ b/addons/stock/static/src/js/forecast_widget.js @@ -31,7 +31,7 @@ const ForecastWidgetField = AbstractField.extend({ if (data.forecast_expected_date && data.date_deadline) { data.forecast_is_late = data.forecast_expected_date > data.date_deadline; } - 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]); + 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.forecast_availability.digits[1]); this.$el.html(QWeb.render('stock.forecastWidget', data)); this.$('.o_forecast_report_button').on('click', this._onOpenReport.bind(this));