|
5 | 5 | NOTE: Duplicate templates removed on 2025-12-04 |
6 | 6 | - portal_container_form: Use portal_container_create_form in portal_container_create.xml |
7 | 7 | - container_detail: Use portal_container_detail in portal_inventory_detail.xml |
| 8 | + |
| 9 | + This file is kept for backwards compatibility but contains no active templates. |
8 | 10 | --> |
9 | 11 | </data> |
10 | 12 | </odoo> |
11 | | - |
12 | | - <div class="form-group"> |
13 | | - <label for="container_type_id">Container Type *</label> |
14 | | - <select name="container_type_id" id="container_type_id" class="form-control" required="required"> |
15 | | - <option value="">Select Container Type...</option> |
16 | | - <t t-foreach="container_types" t-as="ctype"> |
17 | | - <option t-att-value="ctype.id" t-esc="ctype.name"/> |
18 | | - </t> |
19 | | - </select> |
20 | | - </div> |
21 | | - |
22 | | - <div class="form-group"> |
23 | | - <label for="location_id">Initial Location *</label> |
24 | | - <select name="location_id" id="location_id" class="form-control" required="required"> |
25 | | - <option value="">Select Location...</option> |
26 | | - <t t-foreach="locations" t-as="location"> |
27 | | - <option t-att-value="location.id" t-esc="location.complete_name"/> |
28 | | - </t> |
29 | | - </select> |
30 | | - </div> |
31 | | - |
32 | | - <t t-if="has_departments"> |
33 | | - <div class="form-group"> |
34 | | - <label for="department_id">Department</label> |
35 | | - |
36 | | - <!-- Case 1: User has exactly one department - show read-only --> |
37 | | - <t t-if="default_department and not show_department_selector"> |
38 | | - <input type="text" class="form-control" readonly="readonly" |
39 | | - t-att-value="default_department.name"/> |
40 | | - <input type="hidden" name="department_id" t-att-value="default_department.id"/> |
41 | | - </t> |
42 | | - |
43 | | - <!-- Case 2: User has multiple departments - show dropdown --> |
44 | | - <t t-elif="show_department_selector"> |
45 | | - <select name="department_id" id="department_id" class="form-control"> |
46 | | - <option value="">Select Department...</option> |
47 | | - <t t-foreach="departments" t-as="dept"> |
48 | | - <option t-att-value="dept.id" t-esc="dept.name"/> |
49 | | - </t> |
50 | | - </select> |
51 | | - </t> |
52 | | - |
53 | | - <!-- Case 3: Company has departments but user has no access --> |
54 | | - <t t-else=""> |
55 | | - <input type="text" class="form-control text-muted" readonly="readonly" |
56 | | - value="Company Level"/> |
57 | | - <input type="hidden" name="department_id" value=""/> |
58 | | - </t> |
59 | | - </div> |
60 | | - </t> |
61 | | - |
62 | | - <div class="form-group"> |
63 | | - <label for="description">Description</label> |
64 | | - <textarea name="description" id="description" class="form-control" rows="3" placeholder="Optional description of container contents or purpose"></textarea> |
65 | | - </div> |
66 | | - |
67 | | - <div class="form-group"> |
68 | | - <div class="form-check"> |
69 | | - <input type="checkbox" name="generate_barcode" id="generate_barcode" class="form-check-input" checked="checked"/> |
70 | | - <label for="generate_barcode" class="form-check-label"> |
71 | | - Generate barcode automatically |
72 | | - </label> |
73 | | - </div> |
74 | | - <small class="form-text text-muted"> |
75 | | - If unchecked, you can enter a custom barcode below. |
76 | | - </small> |
77 | | - </div> |
78 | | - |
79 | | - <div class="form-group" id="custom_barcode_group" style="display: none;"> |
80 | | - <label for="custom_barcode">Custom Barcode</label> |
81 | | - <input type="text" name="custom_barcode" id="custom_barcode" class="form-control" placeholder="Enter custom barcode"/> |
82 | | - </div> |
83 | | - |
84 | | - <div class="form-group"> |
85 | | - <button type="submit" class="btn btn-success btn-lg"> |
86 | | - <i class="fa fa-plus-circle"></i> Create Container |
87 | | - </button> |
88 | | - <a href="/my/containers" class="btn btn-secondary btn-lg"> |
89 | | - <i class="fa fa-times"></i> Cancel |
90 | | - </a> |
91 | | - </div> |
92 | | - </form> |
93 | | - </div> |
94 | | - </div> |
95 | | - |
96 | | - <script> |
97 | | - // Toggle custom barcode field |
98 | | - document.getElementById('generate_barcode').addEventListener('change', function() { |
99 | | - var customGroup = document.getElementById('custom_barcode_group'); |
100 | | - if (this.checked) { |
101 | | - customGroup.style.display = 'none'; |
102 | | - document.getElementById('custom_barcode').required = false; |
103 | | - } else { |
104 | | - customGroup.style.display = 'block'; |
105 | | - document.getElementById('custom_barcode').required = true; |
106 | | - } |
107 | | - }); |
108 | | - </script> |
109 | | - </div> |
110 | | - </t> |
111 | | - </template> |
112 | | - |
113 | | - <!-- Container Detail Template --> |
114 | | - <template id="container_detail" name="Container Detail"> |
115 | | - <t t-call="portal.portal_layout"> |
116 | | - <t t-set="title">Container Details</t> |
117 | | - |
118 | | - <div class="o_portal_container_detail"> |
119 | | - <div class="card"> |
120 | | - <div class="card-header bg-primary text-white"> |
121 | | - <h3 class="mb-0"> |
122 | | - <i class="fa fa-box"></i> |
123 | | - Container: <span t-esc="container.name"/> |
124 | | - </h3> |
125 | | - </div> |
126 | | - <div class="card-body"> |
127 | | - <div class="row"> |
128 | | - <div class="col-md-6"> |
129 | | - <dl class="row"> |
130 | | - <dt class="col-sm-4">Barcode:</dt> |
131 | | - <dd class="col-sm-8" t-esc="container.barcode or 'N/A'"/> |
132 | | - |
133 | | - <dt class="col-sm-4">Type:</dt> |
134 | | - <dd class="col-sm-8" t-esc="container.container_type_id.name if container.container_type_id else 'N/A'"/> |
135 | | - |
136 | | - <dt class="col-sm-4">Location:</dt> |
137 | | - <dd class="col-sm-8" t-esc="container.location_id.name if container.location_id else 'N/A'"/> |
138 | | - |
139 | | - <dt class="col-sm-4">Status:</dt> |
140 | | - <dd class="col-sm-8"> |
141 | | - <span t-if="container.state == 'pending'" class="badge badge-warning">Pending</span> |
142 | | - <span t-elif="container.state == 'in'" class="badge badge-success">In Storage</span> |
143 | | - <span t-elif="container.state == 'out'" class="badge badge-info">Out</span> |
144 | | - <span t-elif="container.state == 'perm_out'" class="badge badge-secondary">Perm-Out</span> |
145 | | - <span t-elif="container.state == 'destroyed'" class="badge badge-danger">Destroyed</span> |
146 | | - </dd> |
147 | | - </dl> |
148 | | - </div> |
149 | | - <div class="col-md-6"> |
150 | | - <h5>Description</h5> |
151 | | - <p t-esc="container.description or 'No description available'"/> |
152 | | - </div> |
153 | | - </div> |
154 | | - |
155 | | - <div class="mt-3"> |
156 | | - <a href="/my/containers" class="btn btn-secondary"> |
157 | | - <i class="fa fa-arrow-left"></i> Back to Containers |
158 | | - </a> |
159 | | - </div> |
160 | | - </div> |
161 | | - </div> |
162 | | - </div> |
163 | | - </t> |
164 | | - </template> |
165 | | - </data> |
166 | | -</odoo> |
0 commit comments