2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-16 12:05:53 +00:00

More hungry fetching

This commit is contained in:
Oliver Walters
2019-05-21 00:16:00 +10:00
parent 157919f47a
commit 72aba30e81
3 changed files with 7 additions and 4 deletions

View File

@ -532,7 +532,7 @@ class Part(models.Model):
hash = hashlib.md5(str(self.id).encode())
for item in self.bom_items.all().prefetch('sub_part'):
for item in self.bom_items.all().prefetch_related('sub_part'):
hash.update(str(item.sub_part.id).encode())
hash.update(str(item.sub_part.full_name).encode())
hash.update(str(item.quantity).encode())