From f83dc134ef0508a4107aa1d0585c842a18c7cfe8 Mon Sep 17 00:00:00 2001 From: Oliver Date: Wed, 20 Oct 2021 23:20:43 +1100 Subject: [PATCH] linting --- InvenTree/build/serializers.py | 4 ++-- InvenTree/templates/js/translated/build.js | 2 +- InvenTree/templates/js/translated/order.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/InvenTree/build/serializers.py b/InvenTree/build/serializers.py index 0087a1e8b5..f23e2a1db0 100644 --- a/InvenTree/build/serializers.py +++ b/InvenTree/build/serializers.py @@ -309,10 +309,10 @@ class BuildAllocationItemSerializer(serializers.Serializer): def validate_bom_item(self, bom_item): - build = self.context['build'] - # TODO: Fix this validation - allow for variants and substitutes! """ + build = self.context['build'] + # BomItem must point to the same 'part' as the parent build if build.part != bom_item.part: raise ValidationError(_("bom_item.part must point to the same part as the build order")) diff --git a/InvenTree/templates/js/translated/build.js b/InvenTree/templates/js/translated/build.js index d29b81c0b8..b6c98fc49e 100644 --- a/InvenTree/templates/js/translated/build.js +++ b/InvenTree/templates/js/translated/build.js @@ -1407,7 +1407,7 @@ function allocateStockToBuild(build_id, part_id, bom_items, options={}) { onSelect: function(data, field, opts) { // Adjust the 'quantity' field based on availability - if (!("quantity" in data)) { + if (!('quantity' in data)) { return; } diff --git a/InvenTree/templates/js/translated/order.js b/InvenTree/templates/js/translated/order.js index dfac640fee..67fef0b853 100644 --- a/InvenTree/templates/js/translated/order.js +++ b/InvenTree/templates/js/translated/order.js @@ -1666,7 +1666,7 @@ function loadSalesOrderLineItemTable(table, options={}) { onSelect: function(data, field, opts) { // Quantity available from this stock item - if (!("quantity" in data)) { + if (!('quantity' in data)) { return; }