From 92f98cc9715ec69b7001948a7d979d3a4a34a5f2 Mon Sep 17 00:00:00 2001 From: mreficent Date: Wed, 18 Sep 2019 17:33:14 +0200 Subject: [PATCH] [FIX] Don't check in any case of inventory adjustments The virtual adjustment location may be different from the one provided in property_stock_inventory of the product. --- stock_inventory_lockdown/models/stock_move.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stock_inventory_lockdown/models/stock_move.py b/stock_inventory_lockdown/models/stock_move.py index 83f0ef713..915a7ca92 100644 --- a/stock_inventory_lockdown/models/stock_move.py +++ b/stock_inventory_lockdown/models/stock_move.py @@ -29,8 +29,8 @@ class StockMove(models.Model): reserved_locs = move._get_reserved_locations() dest_locs = move._get_dest_locations() if (locked_location_ids and - move.product_id.property_stock_inventory not in [ - move.location_dest_id, move.location_id] and + not any([move.location_dest_id.usage == 'inventory', + move.location_id.usage == 'inventory']) and (move.location_dest_id in locked_location_ids or any([l in locked_location_ids for l in dest_locs]) or any([l in locked_location_ids for l in reserved_locs]))):