[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 <amoyaux@users.noreply.github.com>
This commit is contained in:
nouraellm
2021-03-03 08:58:47 +00:00
committed by Arnold Moyaux
parent 2cc56315a1
commit 2f3978bab7
@@ -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));