mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add "target_date" field to PurchaseOrder
This commit is contained in:
parent
9efde9de29
commit
834d9ec9a1
28
InvenTree/order/migrations/0041_auto_20210114_1728.py
Normal file
28
InvenTree/order/migrations/0041_auto_20210114_1728.py
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
# Generated by Django 3.0.7 on 2021-01-14 06:28
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('order', '0040_salesorder_target_date'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='purchaseorder',
|
||||||
|
name='target_date',
|
||||||
|
field=models.DateField(blank=True, help_text='Expected date for order delivery. Order will be overdue after this date.', null=True, verbose_name='Target Delivery Date'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='purchaseorder',
|
||||||
|
name='complete_date',
|
||||||
|
field=models.DateField(blank=True, help_text='Date order was completed', null=True, verbose_name='Completion Date'),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='purchaseorder',
|
||||||
|
name='issue_date',
|
||||||
|
field=models.DateField(blank=True, help_text='Date order was issued', null=True, verbose_name='Issue Date'),
|
||||||
|
),
|
||||||
|
]
|
@ -119,8 +119,11 @@ class PurchaseOrder(Order):
|
|||||||
supplier: Reference to the company supplying the goods in the order
|
supplier: Reference to the company supplying the goods in the order
|
||||||
supplier_reference: Optional field for supplier order reference code
|
supplier_reference: Optional field for supplier order reference code
|
||||||
received_by: User that received the goods
|
received_by: User that received the goods
|
||||||
|
target_date: Expected delivery target date for PurchaseOrder completion (optional)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
OVERDUE_FILTER = Q(status__in=PurchaseOrderStatus.OPEN) & ~Q(target_date=None) & Q(target_date__lte=datetime.now().date())
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def filterByDate(queryset, min_date, max_date):
|
def filterByDate(queryset, min_date, max_date):
|
||||||
"""
|
"""
|
||||||
@ -186,9 +189,23 @@ class PurchaseOrder(Order):
|
|||||||
related_name='+'
|
related_name='+'
|
||||||
)
|
)
|
||||||
|
|
||||||
issue_date = models.DateField(blank=True, null=True, help_text=_('Date order was issued'))
|
issue_date = models.DateField(
|
||||||
|
blank=True, null=True,
|
||||||
|
verbose_name=_('Issue Date'),
|
||||||
|
help_text=_('Date order was issued')
|
||||||
|
)
|
||||||
|
|
||||||
complete_date = models.DateField(blank=True, null=True, help_text=_('Date order was completed'))
|
target_date = models.DateField(
|
||||||
|
blank=True, null=True,
|
||||||
|
verbose_name=_('Target Delivery Date'),
|
||||||
|
help_text=_('Expected date for order delivery. Order will be overdue after this date.'),
|
||||||
|
)
|
||||||
|
|
||||||
|
complete_date = models.DateField(
|
||||||
|
blank=True, null=True,
|
||||||
|
verbose_name=_('Completion Date'),
|
||||||
|
help_text=_('Date order was completed')
|
||||||
|
)
|
||||||
|
|
||||||
def get_absolute_url(self):
|
def get_absolute_url(self):
|
||||||
return reverse('po-detail', kwargs={'pk': self.id})
|
return reverse('po-detail', kwargs={'pk': self.id})
|
||||||
|
Loading…
Reference in New Issue
Block a user