2
0
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:
Oliver Walters
2020-08-08 09:05:33 +10:00
parent 7b332d93ee
commit bdea29df04
5 changed files with 75 additions and 2 deletions

View File

@ -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)