From 1c71eaba674f2dff0c05f228972e7af34c063c71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 3 Oct 2025 16:41:12 +0200 Subject: [PATCH] Construct move key for assignation by converting list to tuple Instead of creating a new tuple on each field, it is faster to fill a list and convert it to a tuple at the end. --- modules/stock/move.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/stock/move.py b/modules/stock/move.py index 4418eb27b5..6cdc2434ad 100644 --- a/modules/stock/move.py +++ b/modules/stock/move.py @@ -1166,13 +1166,13 @@ class Move(Workflow, ModelSQL, ModelView): grouping_filter=(product_ids,)) def get_key(move, location_id): - key = (location_id,) + key = [location_id] for field in grouping: value = getattr(move, field) if isinstance(value, Model): value = value.id - key += (value,) - return key + key.append(value) + return tuple(key) def get_values(key, location_name): yield location_name, key[0]