mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
POST the data back again
This commit is contained in:
parent
fb96651c15
commit
58336482fe
@ -79,7 +79,7 @@ class BomUploadManager:
|
||||
except tablib.UnsupportedFormat:
|
||||
raise ValidationError({'bom_file': _('Error reading BOM file (invalid data)')})
|
||||
|
||||
def guess_headers(self, header, threshold=80):
|
||||
def guess_header(self, header, threshold=80):
|
||||
""" Try to match a header (from the file) to a list of known headers
|
||||
|
||||
Args:
|
||||
@ -145,7 +145,11 @@ class BomUploadManager:
|
||||
rows = []
|
||||
|
||||
for i in range(self.row_count()):
|
||||
row = self.get_row_data(i)
|
||||
|
||||
row = {
|
||||
'data': self.get_row_data(i),
|
||||
'index': i
|
||||
}
|
||||
|
||||
if row:
|
||||
rows.append(row)
|
||||
|
@ -25,6 +25,7 @@
|
||||
<option value='{{ req }}'{% if req == col.guess %}selected='selected'{% endif %}>{{ req }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<input type='hidden' name='col_{{ forloop.counter0 }}' value='{{ col.name }}'/>
|
||||
{{ col.name }}
|
||||
</th>
|
||||
{% endfor %}
|
||||
@ -34,8 +35,9 @@
|
||||
{% for row in bom_rows %}
|
||||
<tr>
|
||||
<td>{% add forloop.counter 1 %}</td>
|
||||
{% for item in row %}
|
||||
{% for item in row.data %}
|
||||
<td>
|
||||
<input type='hidden' name='row_{{ row.index }}_col_{{ forloop.counter0 }}' value='{{ item }}'/>
|
||||
{{ item }}
|
||||
</td>
|
||||
{% endfor %}
|
||||
|
@ -721,8 +721,6 @@ class BomUpload(AjaxView, FormMixin):
|
||||
form = part_forms.BomUploadSelectFields
|
||||
self.ajax_template_name = 'part/bom_upload/select_fields.html'
|
||||
|
||||
# Try to guess at the
|
||||
|
||||
# Provide context to the next form
|
||||
ctx = {
|
||||
'req_cols': BomUploadManager.HEADERS,
|
||||
|
Loading…
Reference in New Issue
Block a user