From a7826093671921081fb6fd32bf9e3c72eee1b689 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 25 Feb 2016 13:38:46 +0100 Subject: [PATCH] [FIX] stock_quant_manual_assign: Search in all child locations --- .../wizard/assign_manual_quants.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/stock_quant_manual_assign/wizard/assign_manual_quants.py b/stock_quant_manual_assign/wizard/assign_manual_quants.py index fe3a5c8cb..34d774552 100644 --- a/stock_quant_manual_assign/wizard/assign_manual_quants.py +++ b/stock_quant_manual_assign/wizard/assign_manual_quants.py @@ -55,13 +55,14 @@ class AssignManualQuants(models.TransientModel): def default_get(self, var_fields): super(AssignManualQuants, self).default_get(var_fields) move = self.env['stock.move'].browse(self.env.context['active_id']) - available_quants = self.env['stock.quant'].search( - ['|', ('location_id', '=', move.location_id.id), - ('location_id', 'in', move.location_id.child_ids.ids), - ('product_id', '=', move.product_id.id), - ('qty', '>', 0), - '|', ('reservation_id', '=', False), - ('reservation_id', '=', move.id)]) + available_quants = self.env['stock.quant'].search([ + ('location_id', 'child_of', move.location_id.id), + ('product_id', '=', move.product_id.id), + ('qty', '>', 0), + '|', + ('reservation_id', '=', False), + ('reservation_id', '=', move.id) + ]) quants_lines = [{ 'quant': x.id, 'lot_id': x.lot_id.id,