From 7c82857cc7ca57f187e81438488bde0bab2c4d62 Mon Sep 17 00:00:00 2001 From: Oliver Date: Mon, 28 Feb 2022 15:27:56 +1100 Subject: [PATCH] Remove unique_together requirement for purchaseorderlineitem - Allow a single purchase order to specify duplicate lines (e.g. split shipments / order scheduling) --- ...ter_purchaseorderlineitem_unique_together.py | 17 +++++++++++++++++ InvenTree/order/models.py | 1 - 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 InvenTree/order/migrations/0063_alter_purchaseorderlineitem_unique_together.py diff --git a/InvenTree/order/migrations/0063_alter_purchaseorderlineitem_unique_together.py b/InvenTree/order/migrations/0063_alter_purchaseorderlineitem_unique_together.py new file mode 100644 index 0000000000..1c73b6b437 --- /dev/null +++ b/InvenTree/order/migrations/0063_alter_purchaseorderlineitem_unique_together.py @@ -0,0 +1,17 @@ +# Generated by Django 3.2.10 on 2022-02-28 04:27 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('order', '0062_auto_20220228_0321'), + ] + + operations = [ + migrations.AlterUniqueTogether( + name='purchaseorderlineitem', + unique_together=set(), + ), + ] diff --git a/InvenTree/order/models.py b/InvenTree/order/models.py index 1618d336af..fb0ae1c2c5 100644 --- a/InvenTree/order/models.py +++ b/InvenTree/order/models.py @@ -839,7 +839,6 @@ class PurchaseOrderLineItem(OrderLineItem): class Meta: unique_together = ( - ('order', 'part', 'quantity', 'purchase_price') ) @staticmethod