From 22249206d24206c5073e7d7ba33f9c0ba0d25fd5 Mon Sep 17 00:00:00 2001 From: eeintech Date: Thu, 13 May 2021 16:06:57 -0400 Subject: [PATCH 1/2] Fixed duplicate check --- InvenTree/common/views.py | 5 +++-- .../order/templates/order/order_wizard/match_fields.html | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/InvenTree/common/views.py b/InvenTree/common/views.py index fa605c2b80..99862f5c08 100644 --- a/InvenTree/common/views.py +++ b/InvenTree/common/views.py @@ -209,6 +209,7 @@ class FileManagementFormView(MultiStepFormView): context.update({'columns': self.columns}) # Load extra context data + print(self.extra_context_data) for key, items in self.extra_context_data.items(): context.update({key: items}) @@ -449,8 +450,8 @@ class FileManagementFormView(MultiStepFormView): if guess: n = list(self.column_selections.values()).count(self.column_selections[col]) - if n > 1: - duplicates.append(col) + if n > 1 and self.column_selections[col] not in duplicates: + duplicates.append(self.column_selections[col]) # Store extra context data self.extra_context_data = { diff --git a/InvenTree/order/templates/order/order_wizard/match_fields.html b/InvenTree/order/templates/order/order_wizard/match_fields.html index 4ff7b6a963..cd81142341 100644 --- a/InvenTree/order/templates/order/order_wizard/match_fields.html +++ b/InvenTree/order/templates/order/order_wizard/match_fields.html @@ -55,7 +55,7 @@ {{ col }} {% for duplicate in duplicates %} - {% if duplicate == col.name %} + {% if duplicate == col.value %} From a64ab5956b2a1daec62fc8789ce600250882d78f Mon Sep 17 00:00:00 2001 From: eeintech Date: Thu, 13 May 2021 16:07:57 -0400 Subject: [PATCH 2/2] Removed leftover print --- InvenTree/common/views.py | 1 - 1 file changed, 1 deletion(-) diff --git a/InvenTree/common/views.py b/InvenTree/common/views.py index 99862f5c08..857b6b2c51 100644 --- a/InvenTree/common/views.py +++ b/InvenTree/common/views.py @@ -209,7 +209,6 @@ class FileManagementFormView(MultiStepFormView): context.update({'columns': self.columns}) # Load extra context data - print(self.extra_context_data) for key, items in self.extra_context_data.items(): context.update({key: items})