summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2019-11-27 07:00:07 +0000
committerNicolas Martinelli <nim@odoo.com>2019-11-27 07:02:11 +0000
commit4dfa4e2c06119c9637b99ed1de3c6e4b76be2cc2 (patch)
tree957dba99bdfe4e347037461363af7c684f693625 /addons
parentf3dec5d0aec484229738c2a65d4cdf234f9cb3ee (diff)
[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
Diffstat (limited to 'addons')
-rw-r--r--addons/stock/models/stock_picking.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/stock/models/stock_picking.py b/addons/stock/models/stock_picking.py
index 472752f5a6c..8d982eb0c12 100644
--- a/addons/stock/models/stock_picking.py
+++ b/addons/stock/models/stock_picking.py
@@ -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: