From 3930651c59034476395f3800e4426b687ffd3b9a Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sun, 7 Jul 2019 09:57:23 +1000 Subject: [PATCH] Make Reference and Notes fields editable --- InvenTree/part/bom.py | 5 +++++ .../part/templates/part/bom_upload/select_parts.html | 10 +++++++++- InvenTree/part/views.py | 3 ++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/InvenTree/part/bom.py b/InvenTree/part/bom.py index 79d1bc9e5d..b1a7a6d64d 100644 --- a/InvenTree/part/bom.py +++ b/InvenTree/part/bom.py @@ -63,6 +63,11 @@ class BomUploadManager: 'Notes' ] + EDITABLE_HEADERS = [ + 'Reference', + 'Notes' + ] + HEADERS = REQUIRED_HEADERS + OPTIONAL_HEADERS def __init__(self, bom_file): diff --git a/InvenTree/part/templates/part/bom_upload/select_parts.html b/InvenTree/part/templates/part/bom_upload/select_parts.html index 28a64628c6..cfdf06ddc1 100644 --- a/InvenTree/part/templates/part/bom_upload/select_parts.html +++ b/InvenTree/part/templates/part/bom_upload/select_parts.html @@ -46,8 +46,16 @@ {% add row.index 1 %} {% for item in row.data %} - {% if item.column.guess == 'Quantity' %} + {% if item.column.guess == 'Part' %} + +
+ {{ item.cell }} + {% elif item.column.guess == 'Quantity' %} + {% elif item.editable %} + {% else %} {{ item.cell }} {% endif %} diff --git a/InvenTree/part/views.py b/InvenTree/part/views.py index 0efeef42ed..8183b44044 100644 --- a/InvenTree/part/views.py +++ b/InvenTree/part/views.py @@ -688,7 +688,8 @@ class BomUpload(FormView): data.append({ 'cell': item, 'idx': idx, - 'column': self.bom_columns[idx] + 'column': self.bom_columns[idx], + 'editable': self.bom_columns[idx].get('guess', None) in BomUploadManager.EDITABLE_HEADERS }) rows.append({