Skip to content

Commit

Permalink
Merge branch 'master' into table-date-filters
Browse files Browse the repository at this point in the history
  • Loading branch information
SchrodingersGat authored Oct 16, 2024
2 parents 3200a96 + 181e1dd commit e7c03b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/backend/InvenTree/order/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2328,7 +2328,7 @@ def cancel_order(self):
# endregion

@transaction.atomic
def receive_line_item(self, line, location, user, note=''):
def receive_line_item(self, line, location, user, note='', **kwargs):
"""Receive a line item against this ReturnOrder.
Rules:
Expand All @@ -2354,7 +2354,7 @@ def receive_line_item(self, line, location, user, note=''):
deltas['customer'] = stock_item.customer.pk

# Update the StockItem
stock_item.status = StockStatus.QUARANTINED.value
stock_item.status = kwargs.get('status', StockStatus.QUARANTINED.value)
stock_item.location = location
stock_item.customer = None
stock_item.sales_order = None
Expand Down
2 changes: 2 additions & 0 deletions src/backend/InvenTree/stock/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1238,10 +1238,12 @@ def return_from_customer(self, location, user=None, **kwargs):
location=location,
)

# Clear out allocation information for the stock item
self.customer = None
self.belongs_to = None
self.sales_order = None
self.location = location
self.clearAllocations()

trigger_event('stockitem.returnedfromcustomer', id=self.id)

Expand Down

0 comments on commit e7c03b5

Please sign in to comment.