mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Fix user recording when serializing stock
This commit is contained in:
parent
41c07fc423
commit
7c1615a2b6
@ -130,6 +130,8 @@ class StockItem(models.Model):
|
|||||||
add_note = False
|
add_note = False
|
||||||
|
|
||||||
user = kwargs.pop('user', None)
|
user = kwargs.pop('user', None)
|
||||||
|
|
||||||
|
add_note = add_note and kwargs.pop('note', True)
|
||||||
|
|
||||||
super(StockItem, self).save(*args, **kwargs)
|
super(StockItem, self).save(*args, **kwargs)
|
||||||
|
|
||||||
@ -468,7 +470,8 @@ class StockItem(models.Model):
|
|||||||
if location:
|
if location:
|
||||||
new_item.location = location
|
new_item.location = location
|
||||||
|
|
||||||
new_item.save()
|
# The item already has a transaction history, don't create a new note
|
||||||
|
new_item.save(user=user, note=False)
|
||||||
|
|
||||||
# Copy entire transaction history
|
# Copy entire transaction history
|
||||||
new_item.copyHistoryFrom(self)
|
new_item.copyHistoryFrom(self)
|
||||||
|
Loading…
Reference in New Issue
Block a user