2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-08-19 18:05:54 +00:00

Record the user information when creating or updating a stock item

This commit is contained in:
Oliver
2021-11-18 21:26:26 +11:00
parent 8a879832ee
commit bfb32f3bf6
3 changed files with 30 additions and 18 deletions

View File

@@ -79,6 +79,15 @@ class StockItemSerializer(InvenTree.serializers.InvenTreeModelSerializer):
- Includes serialization for the item location
"""
def update(self, instance, validated_data):
"""
Custom update method to pass the user information through to the instance
"""
instance._user = self.context['user']
return super().update(instance, validated_data)
@staticmethod
def annotate_queryset(queryset):
"""