Skip to content

Commit 192dbf8

Browse files
author
John75SunCity
committed
fix: OWL template syntax and AttributeError in 3D view
- Fixed OWL template: Changed 'not' to '!' for JavaScript-style negation The 'not' keyword caused 'Unexpected identifier ctx' error - Fixed _get_containers_metadata: Use getattr() for optional fields (monthly_storage_fee, storage_duration_days, fsm_order_ids, etc.) to prevent AttributeError when fields don't exist on model
1 parent 14af8a3 commit 192dbf8

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

records_management_3d_warehouse/models/warehouse_3d_view_config.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -409,12 +409,12 @@ def _get_containers_metadata(self, containers):
409409
'customer': container.partner_id.name,
410410
'customer_id': container.partner_id.id,
411411
'type': container.container_type_id.name if container.container_type_id else 'N/A',
412-
'monthly_fee': container.monthly_storage_fee or 0,
413-
'age_days': container.storage_duration_days or 0,
414-
'has_fsm': bool(container.fsm_order_ids),
415-
'has_files': bool(container.file_folder_ids),
416-
'file_count': len(container.file_folder_ids),
417-
'security_level': container.location_id.security_level or 'internal',
412+
'monthly_fee': getattr(container, 'monthly_storage_fee', 0) or 0,
413+
'age_days': getattr(container, 'storage_duration_days', 0) or 0,
414+
'has_fsm': bool(getattr(container, 'fsm_order_ids', False)),
415+
'has_files': bool(getattr(container, 'file_folder_ids', False)),
416+
'file_count': len(getattr(container, 'file_folder_ids', [])),
417+
'security_level': getattr(container.location_id, 'security_level', 'internal') or 'internal',
418418
})
419419
return data
420420

records_management_3d_warehouse/static/src/components/warehouse_blueprint_editor.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@
281281
</div>
282282

283283
<!-- Right Sidebar - Navigation Directions -->
284-
<div t-if="state.currentDirections and not state.pickCoordinatesMode and state.pickedPoints.length === 0"
284+
<div t-if="state.currentDirections and !state.pickCoordinatesMode and state.pickedPoints.length === 0"
285285
class="blueprint-sidebar border-start p-3" style="width: 300px; overflow-y: auto;">
286286

287287
<h6 class="mb-3">
@@ -337,7 +337,7 @@
337337
</div>
338338

339339
<!-- Right Sidebar - Selected Element -->
340-
<div t-elif="state.selectedElement and not state.pickCoordinatesMode and state.pickedPoints.length === 0"
340+
<div t-elif="state.selectedElement and !state.pickCoordinatesMode and state.pickedPoints.length === 0"
341341
class="blueprint-sidebar border-start p-3" style="width: 300px; overflow-y: auto;">
342342

343343
<h6 class="mb-3">
@@ -408,7 +408,7 @@
408408
</div>
409409

410410
<!-- Help Panel (when nothing selected) -->
411-
<div t-elif="!state.currentDirections and not state.pickCoordinatesMode and state.pickedPoints.length === 0"
411+
<div t-elif="!state.currentDirections and !state.pickCoordinatesMode and state.pickedPoints.length === 0"
412412
class="blueprint-sidebar border-start p-3" style="width: 250px; overflow-y: auto;">
413413

414414
<h6 class="mb-3">

0 commit comments

Comments
 (0)