details:   https://code.tryton.org/tryton/commit/642d6d1dc2c6
branch:    default
user:      Cédric Krier <[email protected]>
date:      Fri Oct 03 16:41:12 2025 +0200
description:
        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.
diffstat:

 modules/stock/move.py |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (20 lines):

diff -r d90c7bdbcf7f -r 642d6d1dc2c6 modules/stock/move.py
--- a/modules/stock/move.py     Wed Oct 08 17:09:29 2025 +0200
+++ b/modules/stock/move.py     Fri Oct 03 16:41:12 2025 +0200
@@ -1166,13 +1166,13 @@
                         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]

Reply via email to