mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-19 21:45:39 +00:00
Merge branch 'master' into partial-shipment
# Conflicts: # InvenTree/order/serializers.py
This commit is contained in:
@ -15,6 +15,7 @@ from sql_util.utils import SubqueryCount, SubquerySum
|
||||
from djmoney.contrib.django_rest_framework import MoneyField
|
||||
|
||||
from InvenTree.serializers import (InvenTreeAttachmentSerializerField,
|
||||
InvenTreeDecimalField,
|
||||
InvenTreeImageSerializerField,
|
||||
InvenTreeModelSerializer,
|
||||
InvenTreeAttachmentSerializer,
|
||||
@ -120,7 +121,7 @@ class PartSalePriceSerializer(InvenTreeModelSerializer):
|
||||
Serializer for sale prices for Part model.
|
||||
"""
|
||||
|
||||
quantity = serializers.FloatField()
|
||||
quantity = InvenTreeDecimalField()
|
||||
|
||||
price = InvenTreeMoneySerializer(
|
||||
allow_null=True
|
||||
@ -144,7 +145,7 @@ class PartInternalPriceSerializer(InvenTreeModelSerializer):
|
||||
Serializer for internal prices for Part model.
|
||||
"""
|
||||
|
||||
quantity = serializers.FloatField()
|
||||
quantity = InvenTreeDecimalField()
|
||||
|
||||
price = InvenTreeMoneySerializer(
|
||||
allow_null=True
|
||||
@ -428,7 +429,7 @@ class BomItemSerializer(InvenTreeModelSerializer):
|
||||
|
||||
price_range = serializers.CharField(read_only=True)
|
||||
|
||||
quantity = serializers.FloatField()
|
||||
quantity = InvenTreeDecimalField()
|
||||
|
||||
part = serializers.PrimaryKeyRelatedField(queryset=Part.objects.filter(assembly=True))
|
||||
|
||||
|
@ -90,6 +90,13 @@ def inventree_in_debug_mode(*args, **kwargs):
|
||||
return djangosettings.DEBUG
|
||||
|
||||
|
||||
@register.simple_tag()
|
||||
def inventree_demo_mode(*args, **kwargs):
|
||||
""" Return True if the server is running in DEMO mode """
|
||||
|
||||
return djangosettings.DEMO_MODE
|
||||
|
||||
|
||||
@register.simple_tag()
|
||||
def inventree_docker_mode(*args, **kwargs):
|
||||
""" Return True if the server is running as a Docker image """
|
||||
|
Reference in New Issue
Block a user