Fix on_delete for PurchaseOrderLineItem.destination

- Currently set to DO_NOTHING
- However when deleting a StockLocation which has a PurchaseOrderLineItem.destionation point to it, this will cause an IntegrityError
This commit is contained in:
Oliver 2021-09-02 10:41:23 +10:00
parent c90f9b0447
commit 43c4e936a7

View File

@ -778,7 +778,7 @@ class PurchaseOrderLineItem(OrderLineItem):
) )
destination = TreeForeignKey( destination = TreeForeignKey(
'stock.StockLocation', on_delete=models.DO_NOTHING, 'stock.StockLocation', on_delete=models.SET_NULL,
verbose_name=_('Destination'), verbose_name=_('Destination'),
related_name='po_lines', related_name='po_lines',
blank=True, null=True, blank=True, null=True,