From 2373efb47ab564a05fdb500e258993be5f763a49 Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 19 May 2023 15:01:16 +1000 Subject: [PATCH] Fixture fix --- InvenTree/company/fixtures/supplier_part.yaml | 2 +- InvenTree/company/templates/company/supplier_part.html | 6 +++--- InvenTree/order/tests.py | 4 ++-- InvenTree/part/test_pricing.py | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/InvenTree/company/fixtures/supplier_part.yaml b/InvenTree/company/fixtures/supplier_part.yaml index 0ebc07d8d9..7ed59f0e81 100644 --- a/InvenTree/company/fixtures/supplier_part.yaml +++ b/InvenTree/company/fixtures/supplier_part.yaml @@ -66,4 +66,4 @@ part: 4 supplier: 2 SKU: 'R_4K7_0603.100PCK' - pack_size: 100 + pack_units: '100' diff --git a/InvenTree/company/templates/company/supplier_part.html b/InvenTree/company/templates/company/supplier_part.html index 1e88babae3..917b1ad2fe 100644 --- a/InvenTree/company/templates/company/supplier_part.html +++ b/InvenTree/company/templates/company/supplier_part.html @@ -162,11 +162,11 @@ src="{% static 'img/blank_image.png' %}" {{ part.packaging }}{% include "clip.html" %} {% endif %} - {% if part.pack_size != 1.0 %} + {% if part.pack_units %} - {% trans "Pack Quantity" %} - {% decimal part.pack_size %} {% include "part/part_units.html" with part=part.part %} + {% trans "Units" %} + {% part.pack_units %} {% include "part/part_units.html" with part=part.part %} {% endif %} {% if part.note %} diff --git a/InvenTree/order/tests.py b/InvenTree/order/tests.py index b3870f1fb4..a2b4a637b6 100644 --- a/InvenTree/order/tests.py +++ b/InvenTree/order/tests.py @@ -228,7 +228,7 @@ class OrderTest(TestCase): part=prt, supplier=sup, SKU='SKUx10', - pack_size=10, + pack_units='10', ) # Create a new supplier part with smaller pack size @@ -236,7 +236,7 @@ class OrderTest(TestCase): part=prt, supplier=sup, SKU='SKUx0.1', - pack_size=0.1, + pack_units='0.1', ) # Record values before we start diff --git a/InvenTree/part/test_pricing.py b/InvenTree/part/test_pricing.py index 8859acca47..712a958d21 100644 --- a/InvenTree/part/test_pricing.py +++ b/InvenTree/part/test_pricing.py @@ -63,14 +63,14 @@ class PartPricingTests(InvenTreeTestCase): supplier=self.supplier_2, part=self.part, SKU='SUP_2', - pack_size=2.5, + pack_units='2.5', ) self.sp_3 = company.models.SupplierPart.objects.create( supplier=self.supplier_2, part=self.part, SKU='SUP_3', - pack_size=10 + pack_units='10' ) company.models.SupplierPriceBreak.objects.create( @@ -322,7 +322,7 @@ class PartPricingTests(InvenTreeTestCase): # $5 AUD each line_1 = po.add_line_item(self.sp_2, quantity=10, purchase_price=Money(5, 'AUD')) - # $30 CAD each (but pack_size is 10, so really $3 CAD each) + # $30 CAD each (but pack_units is 10, so really $3 CAD each) line_2 = po.add_line_item(self.sp_3, quantity=5, purchase_price=Money(30, 'CAD')) pricing.update_purchase_cost()