[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
This commit is contained in:
Gert Pellin
2019-05-22 13:24:52 +00:00
parent d0cd05a670
commit ec2ea9b08d
+1 -1
View File
@@ -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: