From 1a6f06cceb68a86e3c80b920fcfee7df6701dff7 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Fri, 6 Dec 2019 22:40:27 +1100 Subject: [PATCH] normalize decimal fields --- InvenTree/InvenTree/static/script/inventree/bom.js | 1 - InvenTree/part/models.py | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/InvenTree/InvenTree/static/script/inventree/bom.js b/InvenTree/InvenTree/static/script/inventree/bom.js index e62c8c22f4..8d0accb83b 100644 --- a/InvenTree/InvenTree/static/script/inventree/bom.js +++ b/InvenTree/InvenTree/static/script/inventree/bom.js @@ -282,7 +282,6 @@ function loadBomTable(table, options) { }, formatNoMatches: function() { return "No BOM items found"; }, clickToSelect: true, - showFooter: true, queryParams: function(p) { return params; }, diff --git a/InvenTree/part/models.py b/InvenTree/part/models.py index e265755778..a567be6f00 100644 --- a/InvenTree/part/models.py +++ b/InvenTree/part/models.py @@ -1230,6 +1230,10 @@ class BomItem(models.Model): pmin, pmax = prange + # remove trailing zeros + pmin = pmin.normalize() + pmax = pmax.normalize() + if pmin == pmax: return str(pmin)