2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-29 12:06:44 +00:00

normalize decimal fields

This commit is contained in:
Oliver Walters 2019-12-06 22:40:27 +11:00
parent d5d4cbaec1
commit 1a6f06cceb
2 changed files with 4 additions and 1 deletions

View File

@ -282,7 +282,6 @@ function loadBomTable(table, options) {
}, },
formatNoMatches: function() { return "No BOM items found"; }, formatNoMatches: function() { return "No BOM items found"; },
clickToSelect: true, clickToSelect: true,
showFooter: true,
queryParams: function(p) { queryParams: function(p) {
return params; return params;
}, },

View File

@ -1230,6 +1230,10 @@ class BomItem(models.Model):
pmin, pmax = prange pmin, pmax = prange
# remove trailing zeros
pmin = pmin.normalize()
pmax = pmax.normalize()
if pmin == pmax: if pmin == pmax:
return str(pmin) return str(pmin)