Skip to content
Snippets Groups Projects
Commit f1e79c74 authored by Nicolas Martinelli's avatar Nicolas Martinelli
Browse files

[FIX] sale_stock: product package


- Activate "Product Packagings" in the Sales Settings
- Define a package on a storable product with a contained Qty of 1.8
- Sell 5.4 units of this product in an SO and use the package.

A warning is raised.

This happens because 5.4 % 1.8 = 2.220446049250313e-16

opw-2228859

closes odoo/odoo#49026

Signed-off-by: default avatarNicolas Martinelli (nim) <nim@odoo.com>
parent b9e0178d
No related branches found
No related tags found
No related merge requests found
......@@ -310,7 +310,7 @@ class SaleOrderLine(models.Model):
pack = self.product_packaging
qty = self.product_uom_qty
q = default_uom._compute_quantity(pack.qty, self.product_uom)
if qty and q and (qty % q):
if qty and q and round(qty % q, 2):
newqty = qty - (qty % q) + q
return {
'warning': {
......
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