From 7c9ad4ff7f10fd499d1702a9c540c4f50c33f154 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Tue, 21 Feb 2023 21:29:19 +1100 Subject: [PATCH] Remove get_internal_price method --- InvenTree/part/models.py | 8 -------- InvenTree/part/test_part.py | 8 -------- 2 files changed, 16 deletions(-) diff --git a/InvenTree/part/models.py b/InvenTree/part/models.py index 3e01fc78e2..72c3cfd2dc 100644 --- a/InvenTree/part/models.py +++ b/InvenTree/part/models.py @@ -1758,10 +1758,6 @@ class Part(InvenTreeBarcodeMixin, MetadataMixin, MPTTModel): Returns: Minimum of the supplier, BOM, internal or purchase price. If no pricing available, returns None """ - # only get internal price if set and should be used - if internal and self.has_internal_price_breaks: - internal_price = self.get_internal_price(quantity) - return internal_price, internal_price # only get purchase price if set and should be used if purchase: @@ -1822,10 +1818,6 @@ class Part(InvenTreeBarcodeMixin, MetadataMixin, MPTTModel): price=price ) - def get_internal_price(self, quantity, moq=True, multiples=True, currency=None): - """Return the internal price of this Part at the specified quantity""" - return common.models.get_price(self, quantity, moq, multiples, currency, break_name='internal_price_breaks') - @property def has_internal_price_breaks(self): """Return True if this Part has internal pricing information""" diff --git a/InvenTree/part/test_part.py b/InvenTree/part/test_part.py index 92178ae728..48ff7ae3db 100644 --- a/InvenTree/part/test_part.py +++ b/InvenTree/part/test_part.py @@ -263,14 +263,6 @@ class PartTest(TestCase): self.assertEqual(float(self.r1.get_price(1)), 0.15) self.assertEqual(float(self.r1.get_price(10)), 1.0) - def test_internal_pricing(self): - """Check that the sell pricebreaks were loaded""" - self.assertTrue(self.r1.has_internal_price_breaks) - self.assertEqual(self.r1.internal_price_breaks.count(), 2) - # check that the sell pricebreaks work - self.assertEqual(float(self.r1.get_internal_price(1)), 0.08) - self.assertEqual(float(self.r1.get_internal_price(10)), 0.5) - def test_metadata(self): """Unit tests for the Part metadata field.""" p = Part.objects.get(pk=1)