From 19bca86b3d8de15b4fe64a86875795448e8d628f Mon Sep 17 00:00:00 2001 From: "matthias.lotz" Date: Mon, 9 Mar 2026 21:19:02 +0100 Subject: [PATCH] fix: use unique machine id instead of name for t-foreach key Replace machine.name with machine.id as t-key in t-foreach to prevent 'duplicate key' errors when multiple machines have the same name. Added machine.id to backend response for unique identification. --- open_workshop_base/models/ows_models.py | 1 + open_workshop_pos/static/src/xml/ows_machine_access_list.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/open_workshop_base/models/ows_models.py b/open_workshop_base/models/ows_models.py index ba89c2c..4020b6c 100644 --- a/open_workshop_base/models/ows_models.py +++ b/open_workshop_base/models/ows_models.py @@ -732,6 +732,7 @@ class OwsMachine(models.Model): ('machine_id', '=', machine.id), ], limit=1)) machine_list.append({ + 'id': machine.id, 'name': machine.name, 'has_access': has_access, }) diff --git a/open_workshop_pos/static/src/xml/ows_machine_access_list.xml b/open_workshop_pos/static/src/xml/ows_machine_access_list.xml index 1a76bfc..757e490 100644 --- a/open_workshop_pos/static/src/xml/ows_machine_access_list.xml +++ b/open_workshop_pos/static/src/xml/ows_machine_access_list.xml @@ -59,7 +59,7 @@
    - +