[FIX] stock_barcode: put in pack in receipt
- Activate product packing - Create a PO for a stockable product, validate - In the barcode interface, go to the created picking - Set the product quantity - Click on 'Put in Pack' An error is raised: 'All the products currently reserved in the picking are already in a pack...' In the regular interface, the procedure is to create the move lines manually, therefore setting a quantity done. However, this is not possible in the barcode, and `move_line_nosuggest_ids` is always empty. We introduce a special use case to bypass this in the case of the barcode view. opw-2127637 X-original-commit: d3a7b0e1b1dffd73b9ff31f1ec9fa4f6bbf478d2
This commit is contained in:
@@ -1164,7 +1164,10 @@ class Picking(models.Model):
|
||||
self.ensure_one()
|
||||
if self.state not in ('done', 'cancel'):
|
||||
picking_move_lines = self.move_line_ids
|
||||
if not self.picking_type_id.show_reserved:
|
||||
if (
|
||||
not self.picking_type_id.show_reserved
|
||||
and not self.env.context.get('barcode_view')
|
||||
):
|
||||
picking_move_lines = self.move_line_nosuggest_ids
|
||||
|
||||
move_line_ids = picking_move_lines.filtered(lambda ml:
|
||||
|
||||
Reference in New Issue
Block a user