Nicolas Martinelli d5ecad2a36 [FIX] sale_stock: package with decimal values
Follow-up of f1e79c74a5c07d6be3154629f6f381ebaf907fb1

The issue still arises with:
8 % 1.6 = 1.5999999999999996

The modulo operator on float doesn't seem reliable for our use case,
therefore we use a combination of `float_round` and `float_compare` to
verify the quantity sold is a multiple of the quantity per package.

The rounding threshold is 0.01, meaning that the warning might not be
raised for some specific configurations. For example, 8.005 units with
a package of 1.6 won't return a warning. Since this is a non-blocking
warning, this should be enough for most cases.

opw-2241985

closes odoo/odoo#49983

X-original-commit: 3d48e2b49023eaf1b1dd0c8cb2b7723e41924a38
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-22 13:00:06 +00:00
2020-04-21 12:44:07 +00:00
2020-04-20 11:41:39 +00:00
…
2019-10-03 12:48:09 +00:00
…
…
…
2019-11-08 11:24:04 +00:00
2019-10-03 12:48:09 +00:00

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%