mirror of
https://github.com/inventree/InvenTree.git
synced 2026-10-18 16:06:58 +00:00
Bug fix - Multiplying float by decimal
- Overage percentage now uses explicit decimal multiplication
This commit is contained in:
1 parent
33ffa2f75f
commit
3b9f57fc80
1 file changed
+4
@@ -27,6 +27,7 @@ from django_cleanup import cleanup
|
||||
|
||||
from mptt.models import TreeForeignKey
|
||||
|
||||
from decimal import Decimal
|
||||
from datetime import datetime
|
||||
from fuzzywuzzy import fuzz
|
||||
import hashlib
|
||||
@@ -1208,6 +1209,9 @@ class BomItem(models.Model):
|
||||
if percent < 0:
|
||||
percent = 0
|
||||
|
||||
# Must be represented as a decimal
|
||||
percent = Decimal(percent)
|
||||
|
||||
return int(percent * quantity)
|
||||
|
||||
except ValueError:
|
||||
|
||||
Reference in new issue
Block a user