mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Adds 'issued_by' and 'responsible' field to BuildOrder
- issued_by is a user - responsible is a user or a group
This commit is contained in:
parent
6cc0880b4a
commit
31a8c94d2f
@ -53,6 +53,8 @@ class EditBuildForm(HelperForm):
|
|||||||
'parent',
|
'parent',
|
||||||
'sales_order',
|
'sales_order',
|
||||||
'link',
|
'link',
|
||||||
|
'issued_by',
|
||||||
|
'responsible',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
27
InvenTree/build/migrations/0026_auto_20210216_1539.py
Normal file
27
InvenTree/build/migrations/0026_auto_20210216_1539.py
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# Generated by Django 3.0.7 on 2021-02-16 04:39
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('users', '0005_owner_model'),
|
||||||
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||||
|
('build', '0025_build_target_date'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='build',
|
||||||
|
name='issued_by',
|
||||||
|
field=models.ForeignKey(blank=True, help_text='User who issued this build order', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='builds_issued', to=settings.AUTH_USER_MODEL),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='build',
|
||||||
|
name='responsible',
|
||||||
|
field=models.ForeignKey(blank=True, help_text='User responsible for this build order', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='builds_responsible', to='users.Owner'),
|
||||||
|
),
|
||||||
|
]
|
@ -33,6 +33,7 @@ import InvenTree.fields
|
|||||||
|
|
||||||
from stock import models as StockModels
|
from stock import models as StockModels
|
||||||
from part import models as PartModels
|
from part import models as PartModels
|
||||||
|
from users import models as UserModels
|
||||||
|
|
||||||
|
|
||||||
class Build(MPTTModel):
|
class Build(MPTTModel):
|
||||||
@ -53,6 +54,9 @@ class Build(MPTTModel):
|
|||||||
completion_date: Date the build was completed (or, if incomplete, the expected date of completion)
|
completion_date: Date the build was completed (or, if incomplete, the expected date of completion)
|
||||||
link: External URL for extra information
|
link: External URL for extra information
|
||||||
notes: Text notes
|
notes: Text notes
|
||||||
|
completed_by: User that completed the build
|
||||||
|
issued_by: User that issued the build
|
||||||
|
responsible: User (or group) responsible for completing the build
|
||||||
"""
|
"""
|
||||||
|
|
||||||
OVERDUE_FILTER = Q(status__in=BuildStatus.ACTIVE_CODES) & ~Q(target_date=None) & Q(target_date__lte=datetime.now().date())
|
OVERDUE_FILTER = Q(status__in=BuildStatus.ACTIVE_CODES) & ~Q(target_date=None) & Q(target_date__lte=datetime.now().date())
|
||||||
@ -215,6 +219,22 @@ class Build(MPTTModel):
|
|||||||
related_name='builds_completed'
|
related_name='builds_completed'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
issued_by = models.ForeignKey(
|
||||||
|
User,
|
||||||
|
on_delete=models.SET_NULL,
|
||||||
|
blank=True, null=True,
|
||||||
|
help_text=_('User who issued this build order'),
|
||||||
|
related_name='builds_issued',
|
||||||
|
)
|
||||||
|
|
||||||
|
responsible = models.ForeignKey(
|
||||||
|
UserModels.Owner,
|
||||||
|
on_delete=models.SET_NULL,
|
||||||
|
blank=True, null=True,
|
||||||
|
help_text=_('User responsible for this build order'),
|
||||||
|
related_name='builds_responsible',
|
||||||
|
)
|
||||||
|
|
||||||
link = InvenTree.fields.InvenTreeURLField(
|
link = InvenTree.fields.InvenTreeURLField(
|
||||||
verbose_name=_('External Link'),
|
verbose_name=_('External Link'),
|
||||||
blank=True, help_text=_('Link to external URL')
|
blank=True, help_text=_('Link to external URL')
|
||||||
|
Loading…
Reference in New Issue
Block a user