From c12a482e4de9c84950630cdfcc1c50d52e9bc226 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 15 Apr 2020 13:32:14 +1000 Subject: [PATCH] Add "supplier_reference" field to PurchaseOrder - This is the code that the Supplier uses for the particuarl sales order --- .../0019_purchaseorder_supplier_reference.py | 18 ++++++++++++++++++ InvenTree/order/models.py | 4 +++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 InvenTree/order/migrations/0019_purchaseorder_supplier_reference.py diff --git a/InvenTree/order/migrations/0019_purchaseorder_supplier_reference.py b/InvenTree/order/migrations/0019_purchaseorder_supplier_reference.py new file mode 100644 index 0000000000..cf9cd345bc --- /dev/null +++ b/InvenTree/order/migrations/0019_purchaseorder_supplier_reference.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.10 on 2020-04-15 03:31 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('order', '0018_auto_20200406_0151'), + ] + + operations = [ + migrations.AddField( + model_name='purchaseorder', + name='supplier_reference', + field=models.CharField(blank=True, help_text='Supplier order reference', max_length=64), + ), + ] diff --git a/InvenTree/order/models.py b/InvenTree/order/models.py index 9b569aa4cb..3a7d65abac 100644 --- a/InvenTree/order/models.py +++ b/InvenTree/order/models.py @@ -119,7 +119,7 @@ class PurchaseOrder(Order): supplier: Reference to the company supplying the goods in the order received_by: User that received the goods """ - + ORDER_PREFIX = "PO" supplier = models.ForeignKey( @@ -131,6 +131,8 @@ class PurchaseOrder(Order): help_text=_('Company') ) + supplier_reference = models.CharField(max_length=64, blank=True, help_text=_("Supplier order reference")) + received_by = models.ForeignKey( User, on_delete=models.SET_NULL,