From d301d6391d169d32ecd6c4ed1e8212bb228f0282 Mon Sep 17 00:00:00 2001 From: Pierre Masereel Date: Mon, 16 Oct 2017 16:24:35 +0200 Subject: [PATCH] [FIX] point_of_sale: rounding error when create picking When a return picking is created from a POS order, the methods check that the value rounded to the unit of measure is not null. The problem is that a rounding is passed to the function 'float_is_zero' in the parameter precision_digits instead of precision rounding. This bug has been introduced in rev: https://github.com/odoo/odoo/commit/61304087e7f48c677837dabdc8f1f8aeb18fb52e opw-771282 --- addons/point_of_sale/models/pos_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/models/pos_order.py b/addons/point_of_sale/models/pos_order.py index 840ff6869b9..044a98bb721 100644 --- a/addons/point_of_sale/models/pos_order.py +++ b/addons/point_of_sale/models/pos_order.py @@ -628,7 +628,7 @@ class PosOrder(models.Model): return_picking = Picking.create(return_vals) return_picking.message_post(body=message) - for line in order.lines.filtered(lambda l: l.product_id.type in ['product', 'consu'] and not float_is_zero(l.qty, precision_digits=l.product_id.uom_id.rounding)): + for line in order.lines.filtered(lambda l: l.product_id.type in ['product', 'consu'] and not float_is_zero(l.qty, precision_rounding=l.product_id.uom_id.rounding)): moves |= Move.create({ 'name': line.name, 'product_uom': line.product_id.uom_id.id,