[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 <tic@odoo.com>
This commit is contained in:
Ashmawy Walid (was)
2022-12-02 10:11:12 +01:00
parent b9f2b04435
commit 42e0c4fd4b
+1 -1
View File
@@ -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),