mirror of
https://github.com/inventree/InvenTree.git
synced 2025-12-20 03:03:30 +00:00
- Fixes bug related to importing null "rounding_multiple" BOM field
(cherry picked from commit 7920b0e670)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
committed by
GitHub
parent
10769ccb04
commit
1a8287824b
@@ -646,6 +646,11 @@ class InvenTreeDecimalField(serializers.FloatField):
|
|||||||
|
|
||||||
def to_internal_value(self, data):
|
def to_internal_value(self, data):
|
||||||
"""Convert to python type."""
|
"""Convert to python type."""
|
||||||
|
if data in [None, '']:
|
||||||
|
if self.allow_null:
|
||||||
|
return None
|
||||||
|
raise serializers.ValidationError(_('This field may not be null.'))
|
||||||
|
|
||||||
# Convert the value to a string, and then a decimal
|
# Convert the value to a string, and then a decimal
|
||||||
try:
|
try:
|
||||||
return Decimal(str(data))
|
return Decimal(str(data))
|
||||||
|
|||||||
Reference in New Issue
Block a user