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.
This commit is contained in:
parent
61213b2c0c
commit
19bca86b3d
|
|
@ -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,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@
|
|||
<t t-if="area.machines.length > 0">
|
||||
<div class="client-details-area" t-att-style="'border: solid 3px ' + area.color_hex + '; margin: 5px;'">
|
||||
<ul>
|
||||
<t t-foreach="area.machines" t-as="machine" t-key="machine.name">
|
||||
<t t-foreach="area.machines" t-as="machine" t-key="machine.id">
|
||||
<li class="client-detail">
|
||||
<span t-attf-class="detail {{ machine.has_access ? 'client-details-vvow_briefing' : 'client-details-vvow_briefing_error' }}">
|
||||
<t t-esc="machine.has_access ? '✅' : '❌'" />
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user