Add "responsible" field to PO and SO models

This commit is contained in:
Oliver Walters 2021-03-10 16:19:44 +11:00
parent fb096bd65b
commit 39d44ce32f
2 changed files with 36 additions and 1 deletions

View File

@ -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'),
),
]

View File

@ -21,6 +21,7 @@ from markdownx.models import MarkdownxField
from djmoney.models.fields import MoneyField from djmoney.models.fields import MoneyField
from users import models as UserModels
from part import models as PartModels from part import models as PartModels
from stock import models as stock_models from stock import models as stock_models
from company.models import Company, SupplierPart from company.models import Company, SupplierPart
@ -46,7 +47,7 @@ class Order(models.Model):
created_by: User who created this order (automatically captured) created_by: User who created this order (automatically captured)
issue_date: Date the order was issued issue_date: Date the order was issued
complete_date: Date the order was completed complete_date: Date the order was completed
responsible: User (or group) responsible for managing the order
""" """
@classmethod @classmethod
@ -109,6 +110,15 @@ class Order(models.Model):
related_name='+' 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')) notes = MarkdownxField(blank=True, help_text=_('Order notes'))