[FIX] point_of_sale: multiple lot numbers

- Product tracked by lot:
  3 units of lot A
  2 units of lot B
- On the operation type 'PoS Order', only tick 'create new SN/LN'
- Make 2 PoS orders for 2 units.
- Close the PoS session.

The first picking (2 units of lot A) is done, but the second picking is
ready but not done.

The issue comes from the world famous error:
'Cannot set the done quantity from this stock move, work directly with
the move lines.'

We apply the same logic than in commit f0028bc837

opw-1878256
This commit is contained in:
Nicolas Martinelli
2018-08-30 15:23:04 +02:00
committed by Nicolas Martinelli
parent 2f87bb5169
commit 39162d0ff0
+4 -1
View File
@@ -823,7 +823,10 @@ class PosOrder(models.Model):
'lot_id': lot_id,
})
if not pack_lots and not float_is_zero(qty_done, precision_rounding=move.product_uom.rounding):
move.quantity_done = qty_done
if len(move._get_move_lines()) < 2:
move.quantity_done = qty_done
else:
move._set_quantity_done(qty_done)
return has_wrong_lots
def _prepare_bank_statement_line_payment_values(self, data):