Skip to content
Snippets Groups Projects
Commit c8a73861 authored by Martin Maes's avatar Martin Maes
Browse files

[FIX] stock,mrp: formatting numbers >= 1000 is wrong

In https://github.com/odoo/odoo/pull/123074

, the fix done did not take the formatting of numbers
bigger (or equal) than 1000 into account.
For example, 1000 become "1.000,00" and parsing it again will return a 1.

To fix this, simply modified the thousandsSep to an empty array

closes odoo/odoo#124963

Signed-off-by: default avatarSteve Van Essche <svs@odoo.com>
parent df36c838
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,10 @@ export class ForecastWidgetField extends FloatField {
this.forecastIsLate = data.forecast_expected_date > data.date_deadline;
}
const digits = fields.forecast_availability.digits;
this.willBeFulfilled = parseFloat(formatFloat(data.forecast_availability, {"digits" : digits})) >= parseFloat(formatFloat(data.product_qty, {"digits" : digits}));
const options = { digits, thousandsSep: "", decimalPoint: "." };
const forecast_availability = parseFloat(formatFloat(data.forecast_availability, options));
const product_qty = parseFloat(formatFloat(data.product_qty, options));
this.willBeFulfilled = forecast_availability >= product_qty;
this.state = data.state;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment