Skip to content

Commit fb3001f

Browse files
author
John75SunCity
committed
fix: Remove duplicate portal_file_detail template causing 404
There were two templates with the same ID 'portal_file_detail': 1. portal_file_detail.xml - Uses 'file' variable (correct) 2. portal_inventory_detail.xml - Uses 'file_folder' variable (duplicate) The duplicate was causing template conflicts resulting in 404 errors when accessing /my/inventory/file/<id> routes. Removed the duplicate template from portal_inventory_detail.xml.
1 parent 9b5df44 commit fb3001f

File tree

1 file changed

+2
-91
lines changed

1 file changed

+2
-91
lines changed

records_management/templates/portal_inventory_detail.xml

Lines changed: 2 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -393,97 +393,8 @@
393393
</t>
394394
</template>
395395

396-
<!-- File Folder Detail Template -->
397-
<template id="portal_file_detail" name="File Folder Detail">
398-
<t t-call="portal.portal_layout">
399-
<t t-set="title" t-esc="file_folder.name"/>
400-
401-
<div class="container-fluid">
402-
<h2>
403-
<i class="fa fa-folder text-info"></i>
404-
<span t-esc="file_folder.name"/>
405-
</h2>
406-
407-
<div class="row">
408-
<div class="col-md-6">
409-
<div class="card">
410-
<div class="card-header">
411-
<h5>File Information</h5>
412-
</div>
413-
<div class="card-body">
414-
<table class="table table-sm">
415-
<tr>
416-
<th>Barcode:</th>
417-
<td t-esc="file_folder.barcode or 'No barcode'"/>
418-
</tr>
419-
<tr>
420-
<th>Container:</th>
421-
<td>
422-
<t t-if="file_folder.container_id">
423-
<a t-att-href="'/my/inventory/container/%s' % file_folder.container_id.id"
424-
t-esc="file_folder.container_id.name"/>
425-
</t>
426-
<t t-else="">Not in container</t>
427-
</td>
428-
</tr>
429-
<tr>
430-
<th>Documents:</th>
431-
<td>
432-
<span class="badge badge-info" t-esc="len(documents_in_file)"/>
433-
</td>
434-
</tr>
435-
</table>
436-
</div>
437-
</div>
438-
</div>
439-
</div>
440-
441-
<!-- Documents in File -->
442-
<div class="card mt-4">
443-
<div class="card-header">
444-
<h5>Documents in File (<span t-esc="len(documents_in_file)"/>)</h5>
445-
</div>
446-
<div class="card-body">
447-
<t t-if="not documents_in_file">
448-
<p class="text-muted">No documents in this file folder</p>
449-
</t>
450-
<t t-else="">
451-
<div class="table-responsive">
452-
<table class="table table-sm">
453-
<thead>
454-
<tr>
455-
<th>Document Name</th>
456-
<th>Temp Barcode</th>
457-
<th>PDF Scans</th>
458-
<th>Actions</th>
459-
</tr>
460-
</thead>
461-
<tbody>
462-
<t t-foreach="documents_in_file" t-as="document">
463-
<tr>
464-
<td t-esc="document.name"/>
465-
<td t-esc="document.temp_barcode or 'No barcode'"/>
466-
<td>
467-
<span class="badge badge-success"
468-
t-esc="len(document.attachment_ids.filtered(lambda a: 'pdf' in a.mimetype))"/>
469-
</td>
470-
<td>
471-
<a t-att-href="'/my/inventory/document/%s' % document.id"
472-
class="btn btn-sm btn-outline-primary">
473-
<i class="fa fa-eye"></i> View
474-
</a>
475-
</td>
476-
</tr>
477-
</t>
478-
</tbody>
479-
</table>
480-
</div>
481-
</t>
482-
</div>
483-
</div>
484-
</div>
485-
</t>
486-
</template>
396+
<!-- NOTE: portal_file_detail template moved to portal_file_detail.xml -->
397+
<!-- The duplicate here was causing 404 errors due to template ID conflicts -->
487398

488399
<!-- Document Detail Template -->
489400
<template id="portal_document_detail" name="Document Detail">

0 commit comments

Comments
 (0)