Fix purchase order import form

This commit is contained in:
Oliver 2021-07-15 23:11:59 +10:00
parent c61fc7c1df
commit 09d175f7cf
4 changed files with 11 additions and 9 deletions

View File

@ -99,13 +99,18 @@ class FileManager:
self.update_headers()
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:
header - Header name to look for
threshold - Match threshold for fuzzy search
"""
# Replace null values with empty string
if header is None:
header = ''
# Try for an exact match
for h in self.HEADERS:
if h == header:

View File

@ -145,10 +145,6 @@ src="{% static 'img/blank_image.png' %}"
{% block js_ready %}
{{ block.super }}
enableNavbar({
label: 'po',
toggleId: '#po-menu-toggle',
});
{% if order.status == PurchaseOrderStatus.PENDING and order.lines.count > 0 %}
$("#place-order").click(function() {

View File

@ -3,10 +3,6 @@
{% load i18n %}
{% load static %}
{% block menubar %}
{% include 'order/po_navbar.html' with tab='upload' %}
{% endblock %}
{% block heading %}
{% trans "Upload File for Purchase Order" %}
{{ wizard.form.media }}

View File

@ -77,6 +77,11 @@
{{ block.super }}
enableNavbar({
label: 'po',
toggleId: '#po-menu-toggle',
});
$('#edit-notes').click(function() {
constructForm('{% url "api-po-detail" order.pk %}', {
fields: {