From 722e94774593474cb9723fe4b48ed94e22ab610c Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 3 Feb 2022 16:30:48 +1100 Subject: [PATCH] Only calculate pricing data if required --- InvenTree/part/views.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/InvenTree/part/views.py b/InvenTree/part/views.py index dc6b8a9632..97485ebe32 100644 --- a/InvenTree/part/views.py +++ b/InvenTree/part/views.py @@ -395,10 +395,11 @@ class PartDetail(InvenTreeRoleMixin, DetailView): context.update(**ctx) # Pricing information - ctx = self.get_pricing(self.get_quantity()) - ctx['form'] = self.form_class(initial=self.get_initials()) + if InvenTreeSetting.get_setting('PART_SHOW_PRICE_HISTORY', False): + ctx = self.get_pricing(self.get_quantity()) + ctx['form'] = self.form_class(initial=self.get_initials()) - context.update(ctx) + context.update(ctx) return context