mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-03 04:00:57 +00:00
The 'StockItem' model now has a reference to a SalesOrderLineItem
This commit is contained in:
@ -126,6 +126,7 @@ class StockItem(MPTTModel):
|
||||
build: Link to a Build (if this stock item was created from a build)
|
||||
purchase_order: Link to a PurchaseOrder (if this stock item was created from a PurchaseOrder)
|
||||
infinite: If True this StockItem can never be exhausted
|
||||
sales_order: Link to a SalesOrderLineItem (if this stockitem has been allocated to a sales order)
|
||||
"""
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
@ -353,6 +354,12 @@ class StockItem(MPTTModel):
|
||||
help_text=_('Purchase order for this stock item')
|
||||
)
|
||||
|
||||
sales_order = models.ForeignKey(
|
||||
'order.SalesOrderLineItem',
|
||||
on_delete=models.SET_NULL,
|
||||
related_name='stock_items',
|
||||
null=True)
|
||||
|
||||
# last time the stock was checked / counted
|
||||
stocktake_date = models.DateField(blank=True, null=True)
|
||||
|
||||
|
Reference in New Issue
Block a user