From b19472ad73834a8bb80f3e66098cbed9f378e652 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 14 Aug 2019 13:27:51 +1000 Subject: [PATCH 1/7] Bump version --- InvenTree/InvenTree/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InvenTree/InvenTree/version.py b/InvenTree/InvenTree/version.py index 457ad3bd28..4aba826044 100644 --- a/InvenTree/InvenTree/version.py +++ b/InvenTree/InvenTree/version.py @@ -4,7 +4,7 @@ Provides information on the current InvenTree version import subprocess -INVENTREE_SW_VERSION = "0.0.2" +INVENTREE_SW_VERSION = "0.0.3" def inventreeVersion(): From 335066aef663110a3664ae16d220018904e3af35 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 14 Aug 2019 13:28:06 +1000 Subject: [PATCH 2/7] Fix buttons for order form --- .../order/templates/order/order_wizard/select_parts.html | 8 ++++---- .../order/templates/order/order_wizard/select_pos.html | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/InvenTree/order/templates/order/order_wizard/select_parts.html b/InvenTree/order/templates/order/order_wizard/select_parts.html index b872e5aa71..c25def7054 100644 --- a/InvenTree/order/templates/order/order_wizard/select_parts.html +++ b/InvenTree/order/templates/order/order_wizard/select_parts.html @@ -36,8 +36,8 @@ {{ part.full_name }} {{ part.description }} - @@ -63,8 +63,8 @@ - diff --git a/InvenTree/order/templates/order/order_wizard/select_pos.html b/InvenTree/order/templates/order/order_wizard/select_pos.html index 4ae0a89c95..4988530419 100644 --- a/InvenTree/order/templates/order/order_wizard/select_pos.html +++ b/InvenTree/order/templates/order/order_wizard/select_pos.html @@ -41,8 +41,9 @@ class='btn btn-default btn-create' id='new_po_{{ supplier.id }}' title='Create new purchase order for {{ supplier.name }}' - type='button'> - + type='button' + onclick='newPurchaseOrderFromOrderWizard()'> + From f9fa16a39756fa583597543848dc82609e1e9754 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 14 Aug 2019 13:29:51 +1000 Subject: [PATCH 3/7] Fix remove-row button in stock-adjust form --- InvenTree/stock/templates/stock/stock_adjust.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InvenTree/stock/templates/stock/stock_adjust.html b/InvenTree/stock/templates/stock/stock_adjust.html index 625cb3c3af..ab7bf4005e 100644 --- a/InvenTree/stock/templates/stock/stock_adjust.html +++ b/InvenTree/stock/templates/stock/stock_adjust.html @@ -29,7 +29,7 @@
{{ item.error }} {% endif %} - + {% endfor %} From f90ffcd3dbc1a6ad6a8ea5f11ed13c18ffb60dc7 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 14 Aug 2019 13:35:48 +1000 Subject: [PATCH 4/7] Fix buttons for BOM upload form --- InvenTree/part/bom.py | 4 +--- .../part/templates/part/bom_upload/select_fields.html | 8 ++++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/InvenTree/part/bom.py b/InvenTree/part/bom.py index 1a37aa92d0..baf46e8618 100644 --- a/InvenTree/part/bom.py +++ b/InvenTree/part/bom.py @@ -149,9 +149,7 @@ class BomUploadManager: return len(self.data.headers) def row_count(self): - """ Return the number of rows in the file. - Ignored the top rows as indicated by 'starting row' - """ + """ Return the number of rows in the file. """ if self.data is None: return 0 diff --git a/InvenTree/part/templates/part/bom_upload/select_fields.html b/InvenTree/part/templates/part/bom_upload/select_fields.html index 50e55f40da..026ffb1a40 100644 --- a/InvenTree/part/templates/part/bom_upload/select_fields.html +++ b/InvenTree/part/templates/part/bom_upload/select_fields.html @@ -40,8 +40,8 @@
{{ col.name }} -
@@ -69,8 +69,8 @@ {% for row in bom_rows %} - {{ forloop.counter }} From 5963f7ed011829f3347bd460a7ed4a2ad3f9cd6d Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 14 Aug 2019 13:54:16 +1000 Subject: [PATCH 5/7] Deleted unused form --- InvenTree/part/forms.py | 12 ------------ .../templates/part/bom_upload/select_fields.html | 3 --- InvenTree/part/views.py | 15 ++++----------- 3 files changed, 4 insertions(+), 26 deletions(-) diff --git a/InvenTree/part/forms.py b/InvenTree/part/forms.py index 38280bbc1c..286f8ac451 100644 --- a/InvenTree/part/forms.py +++ b/InvenTree/part/forms.py @@ -51,18 +51,6 @@ class BomUploadSelectFile(HelperForm): ] -class BomUploadSelectFields(HelperForm): - """ Form for selecting BOM fields """ - - starting_row = forms.IntegerField(required=True, initial=2, help_text='Index of starting row', validators=[MinValueValidator(1)]) - - class Meta: - model = Part - fields = [ - 'starting_row', - ] - - class EditPartAttachmentForm(HelperForm): """ Form for editing a PartAttachment object """ diff --git a/InvenTree/part/templates/part/bom_upload/select_fields.html b/InvenTree/part/templates/part/bom_upload/select_fields.html index 026ffb1a40..21849f31f8 100644 --- a/InvenTree/part/templates/part/bom_upload/select_fields.html +++ b/InvenTree/part/templates/part/bom_upload/select_fields.html @@ -24,9 +24,6 @@
{% csrf_token %} - {% load crispy_forms_tags %} - - {% crispy form %} diff --git a/InvenTree/part/views.py b/InvenTree/part/views.py index b7bed73003..b3e9807404 100644 --- a/InvenTree/part/views.py +++ b/InvenTree/part/views.py @@ -671,13 +671,8 @@ class BomUpload(FormView): def get_form_class(self): - form_step = self.request.POST.get('form_step', None) - - if form_step == 'select_fields': - return part_forms.BomUploadSelectFields - else: - # Default form is the starting point - return part_forms.BomUploadSelectFile + # Default form is the starting point + return part_forms.BomUploadSelectFile def get_context_data(self, *args, **kwargs): @@ -776,7 +771,7 @@ class BomUpload(FormView): if bom_file_valid: # BOM file is valid? Proceed to the next step! - form = part_forms.BomUploadSelectFields + form = None self.template_name = 'part/bom_upload/select_fields.html' self.extractDataFromFile(manager) @@ -983,8 +978,6 @@ class BomUpload(FormView): self.getTableDataFromPost() valid = len(self.missing_columns) == 0 and not self.duplicates - - form = part_forms.BomUploadSelectFields if valid: # Try to extract meaningful data @@ -994,7 +987,7 @@ class BomUpload(FormView): else: self.template_name = 'part/bom_upload/select_fields.html' - return self.render_to_response(self.get_context_data(form=form)) + return self.render_to_response(self.get_context_data(form=None)) def handlePartSelection(self): From 6c736496871f2f8b21bb8132484bf77ffd898249 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 14 Aug 2019 16:35:26 +1000 Subject: [PATCH 6/7] PEP fix --- InvenTree/part/forms.py | 1 - InvenTree/part/views.py | 1 - 2 files changed, 2 deletions(-) diff --git a/InvenTree/part/forms.py b/InvenTree/part/forms.py index 286f8ac451..0d82183a93 100644 --- a/InvenTree/part/forms.py +++ b/InvenTree/part/forms.py @@ -8,7 +8,6 @@ from __future__ import unicode_literals from InvenTree.forms import HelperForm from django import forms -from django.core.validators import MinValueValidator from .models import Part, PartCategory, PartAttachment from .models import BomItem diff --git a/InvenTree/part/views.py b/InvenTree/part/views.py index b3e9807404..3b475cec7b 100644 --- a/InvenTree/part/views.py +++ b/InvenTree/part/views.py @@ -982,7 +982,6 @@ class BomUpload(FormView): if valid: # Try to extract meaningful data self.preFillSelections() - form = None self.template_name = 'part/bom_upload/select_parts.html' else: self.template_name = 'part/bom_upload/select_fields.html' From 6106d337325ddc0e15aa8ddc72426f2ca7c26eda Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 14 Aug 2019 16:40:14 +1000 Subject: [PATCH 7/7] More span / button fixes --- InvenTree/order/templates/order/receive_parts.html | 4 ++-- .../part/templates/part/bom_upload/select_parts.html | 8 ++++---- InvenTree/part/templates/part/set_category.html | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/InvenTree/order/templates/order/receive_parts.html b/InvenTree/order/templates/order/receive_parts.html index 68a6533b2e..9f773cd411 100644 --- a/InvenTree/order/templates/order/receive_parts.html +++ b/InvenTree/order/templates/order/receive_parts.html @@ -57,8 +57,8 @@ Receive outstanding parts for {{ order }} - {{ order.description }} - diff --git a/InvenTree/part/templates/part/bom_upload/select_parts.html b/InvenTree/part/templates/part/bom_upload/select_parts.html index 7cc9cd8364..9faeacc3ea 100644 --- a/InvenTree/part/templates/part/bom_upload/select_parts.html +++ b/InvenTree/part/templates/part/bom_upload/select_parts.html @@ -47,8 +47,8 @@ {% for row in bom_rows %} - @@ -57,8 +57,8 @@ {% for item in row.data %} {% if item.column.guess == 'Part' %} -