From ec2ea9b08d7abd4ff0f0935cd9459a96632d3a3a Mon Sep 17 00:00:00 2001 From: Gert Pellin Date: Wed, 22 May 2019 12:18:21 +0000 Subject: [PATCH] [FIX] point_of_sale: quantity of lot return * Do a product return of a product with a lotnumber required. * pay the order. * Close and finalise the PoS session. Current behaviour before PR: * A product move is generated with a negative value with destination stock. * Odoo will ask if you want to make a backorder. Desired behaviour after PR is merged: * A product move is generated with a positive value and can be set done without any issues. To fix this problem the quantity of the picking has to be set to the absolute value of the orderline quantity. closes #33512 --- 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 f38e19becaa..dd970f4f146 100644 --- a/addons/point_of_sale/models/pos_order.py +++ b/addons/point_of_sale/models/pos_order.py @@ -856,7 +856,7 @@ class PosOrder(models.Model): # a serialnumber always has a quantity of 1 product, a lot number takes the full quantity of the order line qty = 1.0 if stock_production_lot.product_id.tracking == 'lot': - qty = pos_pack_lot.pos_order_line_id.qty + qty = abs(pos_pack_lot.pos_order_line_id.qty) qty_done += qty pack_lots.append({'lot_id': stock_production_lot.id, 'qty': qty}) else: