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:
|
except tablib.UnsupportedFormat:
|
||||||
raise ValidationError({'bom_file': _('Error reading BOM file (invalid data)')})
|
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
|
""" Try to match a header (from the file) to a list of known headers
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -145,7 +145,11 @@ class BomUploadManager:
|
|||||||
rows = []
|
rows = []
|
||||||
|
|
||||||
for i in range(self.row_count()):
|
for i in range(self.row_count()):
|
||||||
row = self.get_row_data(i)
|
|
||||||
|
row = {
|
||||||
|
'data': self.get_row_data(i),
|
||||||
|
'index': i
|
||||||
|
}
|
||||||
|
|
||||||
if row:
|
if row:
|
||||||
rows.append(row)
|
rows.append(row)
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
<option value='{{ req }}'{% if req == col.guess %}selected='selected'{% endif %}>{{ req }}</option>
|
<option value='{{ req }}'{% if req == col.guess %}selected='selected'{% endif %}>{{ req }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
|
<input type='hidden' name='col_{{ forloop.counter0 }}' value='{{ col.name }}'/>
|
||||||
{{ col.name }}
|
{{ col.name }}
|
||||||
</th>
|
</th>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@ -34,8 +35,9 @@
|
|||||||
{% for row in bom_rows %}
|
{% for row in bom_rows %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{% add forloop.counter 1 %}</td>
|
<td>{% add forloop.counter 1 %}</td>
|
||||||
{% for item in row %}
|
{% for item in row.data %}
|
||||||
<td>
|
<td>
|
||||||
|
<input type='hidden' name='row_{{ row.index }}_col_{{ forloop.counter0 }}' value='{{ item }}'/>
|
||||||
{{ item }}
|
{{ item }}
|
||||||
</td>
|
</td>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -721,8 +721,6 @@ class BomUpload(AjaxView, FormMixin):
|
|||||||
form = part_forms.BomUploadSelectFields
|
form = part_forms.BomUploadSelectFields
|
||||||
self.ajax_template_name = 'part/bom_upload/select_fields.html'
|
self.ajax_template_name = 'part/bom_upload/select_fields.html'
|
||||||
|
|
||||||
# Try to guess at the
|
|
||||||
|
|
||||||
# Provide context to the next form
|
# Provide context to the next form
|
||||||
ctx = {
|
ctx = {
|
||||||
'req_cols': BomUploadManager.HEADERS,
|
'req_cols': BomUploadManager.HEADERS,
|
||||||
|
Loading…
Reference in New Issue
Block a user