mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Fix purchase order import form
This commit is contained in:
parent
c61fc7c1df
commit
09d175f7cf
@ -99,13 +99,18 @@ class FileManager:
|
|||||||
self.update_headers()
|
self.update_headers()
|
||||||
|
|
||||||
def guess_header(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:
|
||||||
header - Header name to look for
|
header - Header name to look for
|
||||||
threshold - Match threshold for fuzzy search
|
threshold - Match threshold for fuzzy search
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# Replace null values with empty string
|
||||||
|
if header is None:
|
||||||
|
header = ''
|
||||||
|
|
||||||
# Try for an exact match
|
# Try for an exact match
|
||||||
for h in self.HEADERS:
|
for h in self.HEADERS:
|
||||||
if h == header:
|
if h == header:
|
||||||
|
@ -145,10 +145,6 @@ src="{% static 'img/blank_image.png' %}"
|
|||||||
{% block js_ready %}
|
{% block js_ready %}
|
||||||
{{ block.super }}
|
{{ block.super }}
|
||||||
|
|
||||||
enableNavbar({
|
|
||||||
label: 'po',
|
|
||||||
toggleId: '#po-menu-toggle',
|
|
||||||
});
|
|
||||||
|
|
||||||
{% if order.status == PurchaseOrderStatus.PENDING and order.lines.count > 0 %}
|
{% if order.status == PurchaseOrderStatus.PENDING and order.lines.count > 0 %}
|
||||||
$("#place-order").click(function() {
|
$("#place-order").click(function() {
|
||||||
|
@ -3,10 +3,6 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% load static %}
|
{% load static %}
|
||||||
|
|
||||||
{% block menubar %}
|
|
||||||
{% include 'order/po_navbar.html' with tab='upload' %}
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block heading %}
|
{% block heading %}
|
||||||
{% trans "Upload File for Purchase Order" %}
|
{% trans "Upload File for Purchase Order" %}
|
||||||
{{ wizard.form.media }}
|
{{ wizard.form.media }}
|
||||||
|
@ -77,6 +77,11 @@
|
|||||||
|
|
||||||
{{ block.super }}
|
{{ block.super }}
|
||||||
|
|
||||||
|
enableNavbar({
|
||||||
|
label: 'po',
|
||||||
|
toggleId: '#po-menu-toggle',
|
||||||
|
});
|
||||||
|
|
||||||
$('#edit-notes').click(function() {
|
$('#edit-notes').click(function() {
|
||||||
constructForm('{% url "api-po-detail" order.pk %}', {
|
constructForm('{% url "api-po-detail" order.pk %}', {
|
||||||
fields: {
|
fields: {
|
||||||
|
Loading…
Reference in New Issue
Block a user