From 0a328687a5a783a8b7e165c8f5223039045abf7d Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Fri, 2 Aug 2019 11:11:28 +1000 Subject: [PATCH] BOM hash includes reference fields --- InvenTree/part/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/InvenTree/part/models.py b/InvenTree/part/models.py index e56466c832..9e0b2cea29 100644 --- a/InvenTree/part/models.py +++ b/InvenTree/part/models.py @@ -634,7 +634,8 @@ class Part(models.Model): For hash is calculated from the following fields of each BOM item: - Part.full_name (if the part name changes, the BOM checksum is invalidated) - - quantity + - Quantity + - Reference field - Note field returns a string representation of a hash object which can be compared with a stored value @@ -647,6 +648,7 @@ class Part(models.Model): hash.update(str(item.sub_part.full_name).encode()) hash.update(str(item.quantity).encode()) hash.update(str(item.note).encode()) + hash.update(str(item.reference).encode()) return str(hash.digest())