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

Merge pull request #2328 from SchrodingersGat/stock-item-create-fix

Record the user information when creating or updating a stock item
This commit is contained in:
Oliver
2021-11-18 23:34:41 +11:00
committed by GitHub
3 changed files with 30 additions and 18 deletions

View File

@@ -81,6 +81,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):
"""