Skip to content
Snippets Groups Projects
Commit 4dfa4e2c authored by Nicolas Martinelli's avatar Nicolas Martinelli
Browse files

[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: d3a7b0e1
parent f3dec5d0
No related branches found
No related tags found
No related merge requests found
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment