mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-06 05:30:56 +00:00
Add functionality to return stock item from customer
This commit is contained in:
@ -495,6 +495,23 @@ class StockItem(MPTTModel):
|
||||
# Return the reference to the stock item
|
||||
return item
|
||||
|
||||
def returnFromCustomer(self, location, user=None):
|
||||
"""
|
||||
Return stock item from customer, back into the specified location.
|
||||
"""
|
||||
|
||||
self.addTransactionNote(
|
||||
_("Returned from customer") + " " + self.customer.name,
|
||||
user,
|
||||
notes=_("Returned to location") + " " + location.name,
|
||||
system=True
|
||||
)
|
||||
|
||||
self.customer = None
|
||||
self.location = location
|
||||
|
||||
self.save()
|
||||
|
||||
# If stock item is incoming, an (optional) ETA field
|
||||
# expected_arrival = models.DateField(null=True, blank=True)
|
||||
|
||||
|
Reference in New Issue
Block a user