diff --git a/InvenTree/order/migrations/0042_auto_20210310_1619.py b/InvenTree/order/migrations/0042_auto_20210310_1619.py new file mode 100644 index 0000000000..9d07bc18f3 --- /dev/null +++ b/InvenTree/order/migrations/0042_auto_20210310_1619.py @@ -0,0 +1,25 @@ +# Generated by Django 3.0.7 on 2021-03-10 05:19 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0005_owner_model'), + ('order', '0041_auto_20210114_1728'), + ] + + operations = [ + migrations.AddField( + model_name='purchaseorder', + name='responsible', + field=models.ForeignKey(blank=True, help_text='User or group responsible for this order', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='users.Owner', verbose_name='Responsible'), + ), + migrations.AddField( + model_name='salesorder', + name='responsible', + field=models.ForeignKey(blank=True, help_text='User or group responsible for this order', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='users.Owner', verbose_name='Responsible'), + ), + ] diff --git a/InvenTree/order/models.py b/InvenTree/order/models.py index d4d90b4d93..c3b33eaace 100644 --- a/InvenTree/order/models.py +++ b/InvenTree/order/models.py @@ -21,6 +21,7 @@ from markdownx.models import MarkdownxField from djmoney.models.fields import MoneyField +from users import models as UserModels from part import models as PartModels from stock import models as stock_models from company.models import Company, SupplierPart @@ -46,7 +47,7 @@ class Order(models.Model): created_by: User who created this order (automatically captured) issue_date: Date the order was issued complete_date: Date the order was completed - + responsible: User (or group) responsible for managing the order """ @classmethod @@ -109,6 +110,15 @@ class Order(models.Model): related_name='+' ) + responsible = models.ForeignKey( + UserModels.Owner, + on_delete=models.SET_NULL, + blank=True, null=True, + help_text=_('User or group responsible for this order'), + verbose_name=_('Responsible'), + related_name='+', + ) + notes = MarkdownxField(blank=True, help_text=_('Order notes'))