diff --git a/addons/stock/models/product.py b/addons/stock/models/product.py index c261d25529e..cc5eeb3f3ef 100644 --- a/addons/stock/models/product.py +++ b/addons/stock/models/product.py @@ -120,8 +120,8 @@ class Product(models.Model): Move = self.env['stock.move'] Quant = self.env['stock.quant'] - domain_move_in_todo = [('state', 'not in', ('done', 'cancel', 'draft'))] + domain_move_in - domain_move_out_todo = [('state', 'not in', ('done', 'cancel', 'draft'))] + domain_move_out + domain_move_in_todo = [('state', 'in', ('waiting', 'confirmed', 'assigned', 'partially_available'))] + domain_move_in + domain_move_out_todo = [('state', 'in', ('waiting', 'confirmed', 'assigned', 'partially_available'))] + domain_move_out moves_in_res = dict((item['product_id'][0], item['product_qty']) for item in Move.read_group(domain_move_in_todo, ['product_id', 'product_qty'], ['product_id'], orderby='id')) moves_out_res = dict((item['product_id'][0], item['product_qty']) for item in Move.read_group(domain_move_out_todo, ['product_id', 'product_qty'], ['product_id'], orderby='id')) quants_res = dict((item['product_id'][0], item['quantity']) for item in Quant.read_group(domain_quant, ['product_id', 'quantity'], ['product_id'], orderby='id'))