From fd63f6f1288abbe4048e80046881b6888dc2db85 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 18 Mar 2022 17:40:10 +0100 Subject: [PATCH] [FIX] stock_account_quantity_history_location: location filter When filtering svl by location we don't want to let outgoing svls out. Normally, we want all the location's related movements to get the whole picture. TT35218 --- .../wizards/stock_quantity_history.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/stock_account_quantity_history_location/wizards/stock_quantity_history.py b/stock_account_quantity_history_location/wizards/stock_quantity_history.py index 8d8220b..2388e65 100644 --- a/stock_account_quantity_history_location/wizards/stock_quantity_history.py +++ b/stock_account_quantity_history_location/wizards/stock_quantity_history.py @@ -29,10 +29,23 @@ class StockQuantityHistory(models.TransientModel): ) action["context"] = ctx if self.env.context.get("active_model") == "stock.valuation.layer": + operator = "child_of" if self.include_child_locations else "=" action["domain"] = expression.AND( [ action["domain"], - [("stock_move_id.location_dest_id", "=", self.location_id.id)], + [ + "|", + ( + "stock_move_id.location_dest_id", + operator, + self.location_id.id, + ), + ( + "stock_move_id.location_id", + operator, + self.location_id.id, + ), + ], ] ) else: