Skip to content

Commit d9065ef

Browse files
author
John75SunCity
committed
fix: Move diagram-data script inside container for JS access
The #diagram-data script element was placed outside the .o_portal_organization_diagram container, so the JavaScript couldn't find it with container.querySelector('#diagram-data'). Moved the script inside the container so the portal organization diagram can properly parse and display the JSON node/edge data.
1 parent 192dbf8 commit d9065ef

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

records_management/templates/portal_organization_diagram.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -245,14 +245,14 @@
245245
</div>
246246
</div>
247247

248-
</div>
249-
250-
<!-- JSON payload (consumed by JS asset) -->
251-
<!-- Note: node_data_json, edge_data_json, diagram_stats_json are pre-serialized JSON strings from controller -->
252-
<!-- Using t-out with no escaping since data is already properly JSON-encoded from controller -->
253-
<script type="application/json" id="diagram-data">
248+
<!-- JSON payload (consumed by JS asset) - MUST be inside .o_portal_organization_diagram -->
249+
<!-- Note: node_data_json, edge_data_json, diagram_stats_json are pre-serialized JSON strings from controller -->
250+
<!-- Using t-out with no escaping since data is already properly JSON-encoded from controller -->
251+
<script type="application/json" id="diagram-data">
254252
{"nodes": <t t-out="diagram.get('node_data_json', '[]')"/>, "edges": <t t-out="diagram.get('edge_data_json', '[]')"/>, "stats": <t t-out="diagram.get('diagram_stats_json', '{}')"/>, "config": {"show_messaging": <t t-out="diagram.get('show_messaging') and 'true' or 'false'"/>, "show_access_rights": <t t-out="diagram.get('show_access_rights') and 'true' or 'false'"/>, "layout_type": "<t t-out="diagram.get('layout_type', 'hierarchical')"/>", "diagram_id": <t t-out="diagram.get('id', 0)"/>, "user_id": <t t-out="user.id"/>, "partner_id": <t t-out="partner.id"/>}}
255-
</script>
253+
</script>
254+
255+
</div>
256256

257257
</t>
258258
</template>

0 commit comments

Comments
 (0)