Adds "target_date" field to PurchaseOrderLineItem and SalesOrderLineItem models

- Allows different target dates to be specified for different line items
- If not set (null) then the base "target_date" parameter for the parent order is used
This commit is contained in:
Oliver 2022-02-28 14:26:01 +11:00
parent 010ce48ce0
commit 557aa44904
4 changed files with 37 additions and 2 deletions

View File

@ -12,11 +12,14 @@ import common.models
INVENTREE_SW_VERSION = "0.7.0 dev"
# InvenTree API version
INVENTREE_API_VERSION = 26
INVENTREE_API_VERSION = 27
"""
Increment this API version number whenever there is a significant change to the API that any clients need to know about
v27 -> 2022-02-28
- Adds target_date field to individual line items for purchase orders and sales orders
v26 -> 2022-02-17
- Adds API endpoint for uploading a BOM file and extracting data

View File

@ -0,0 +1,23 @@
# Generated by Django 3.2.10 on 2022-02-28 03:21
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('order', '0061_merge_0054_auto_20211201_2139_0060_auto_20211129_1339'),
]
operations = [
migrations.AddField(
model_name='purchaseorderlineitem',
name='target_date',
field=models.DateField(blank=True, help_text='Target shipping date for this line item', null=True, verbose_name='Target Date'),
),
migrations.AddField(
model_name='salesorderlineitem',
name='target_date',
field=models.DateField(blank=True, help_text='Target shipping date for this line item', null=True, verbose_name='Target Date'),
),
]

View File

@ -794,8 +794,9 @@ class OrderLineItem(models.Model):
Attributes:
quantity: Number of items
reference: Reference text (e.g. customer reference) for this line item
note: Annotation for the item
target_date: An (optional) date for expected shipment of this line item.
"""
class Meta:
@ -813,6 +814,12 @@ class OrderLineItem(models.Model):
notes = models.CharField(max_length=500, blank=True, verbose_name=_('Notes'), help_text=_('Line item notes'))
target_date = models.DateField(
blank=True, null=True,
verbose_name=_('Target Date'),
help_text=_('Target shipping date for this line item'),
)
class PurchaseOrderLineItem(OrderLineItem):
""" Model for a purchase order line item.

View File

@ -194,6 +194,7 @@ class POLineItemSerializer(InvenTreeModelSerializer):
'purchase_price_string',
'destination',
'destination_detail',
'target_date',
'total_price',
]
@ -605,6 +606,7 @@ class SOLineItemSerializer(InvenTreeModelSerializer):
'sale_price_currency',
'sale_price_string',
'shipped',
'target_date',
]