fix bug of free products from pos in update
This commit is contained in:
@@ -14,8 +14,11 @@ class POSFreeProductSerializer(serializers.ModelSerializer):
|
||||
"""
|
||||
@check free product for pos to be unique
|
||||
"""
|
||||
organization = attrs['organization']
|
||||
|
||||
if not self.instance:
|
||||
|
||||
product = attrs['product']
|
||||
organization = attrs['organization']
|
||||
|
||||
if self.Meta.model.objects.filter(organization=organization, product=product).exists():
|
||||
raise FreePOSProductUniqueCheck()
|
||||
|
||||
Reference in New Issue
Block a user