From 42e0c4fd4b0d7ec978141480aadd7d5077d71554 Mon Sep 17 00:00:00 2001 From: "Ashmawy Walid (was)" Date: Wed, 30 Nov 2022 14:36:24 +0000 Subject: [PATCH] [FIX] stock: prevent crash when trying to mark as done when it involves multiple pickings closes odoo/odoo#107008 X-original-commit: 8e4b9b9f1511096ce4a3ccd6f13044ce621c4b0b Signed-off-by: Tiffany Chang --- addons/stock/models/stock_picking.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/models/stock_picking.py b/addons/stock/models/stock_picking.py index 4442632cdd6..6a50e393f2c 100644 --- a/addons/stock/models/stock_picking.py +++ b/addons/stock/models/stock_picking.py @@ -1075,7 +1075,7 @@ class Picking(models.Model): lines = self.move_ids.filtered(lambda m: m.product_id.type == 'product' and m.state != 'cancel' and m.quantity_done and not m.move_dest_ids) if lines: # don't show reception report if all already assigned/nothing to assign - wh_location_ids = self.env['stock.location']._search([('id', 'child_of', self.picking_type_id.warehouse_id.view_location_id.id), ('usage', '!=', 'supplier')]) + wh_location_ids = self.env['stock.location']._search([('id', 'child_of', self.picking_type_id.warehouse_id.view_location_id.ids), ('usage', '!=', 'supplier')]) if self.env['stock.move'].search([ ('state', 'in', ['confirmed', 'partially_available', 'waiting', 'assigned']), ('product_qty', '>', 0),