[FIX] Correct floating number comparison for min_quantity orderpoint in scheduler

Fix basic floating point math issue in procurement scheduler when comparing
current quantity with orderpoint minimum quantity. In certain cases floating
point comparison could result in e.g 400.0 < 400.0 == True due to typical
floating point comparison issues, as Odoo doesn't use Decimal types where the
issue doesn't exist.
Use float_compare helper to solve this with floating point type.
We will work with the float_compare instead of with the Decimal as with
Decimal, fractions will give errors too and the roundings of the UoMs are
important to take into account.  If there is a way to do the conversions
from one to another UoM better with Decimal, it would be interesting.

On Wed, Dec 3, 2014 at 1:30 PM, Mart Raudsepp <notifications@github.com>
wrote:

> In addons/stock/procurement.py:
>
> >                              continue
> >
> >                          qty -= orderpoint_obj.subtract_procurements(cr, uid, op, context=context)
> >
> > -                        if qty > 0:
> > +                        if float_compare(qty, 0.0, precision_rounding=op.product_uom.rounding) > 0:
>
> and even better would be to actually use the Decimal module whenever
> numeric/decimal is used in the database, so all these problems would simply
> not exist. But I have no idea if any changes towards that would be outright
> rejected or not.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/odoo/odoo/pull/3346/files#r21228026>.
>