From 20e654ddeabc1eb15d246bc8449a4198b16748f9 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Thu, 8 Nov 2018 09:57:27 -0600 Subject: [PATCH] Display "suggested price" when viewing product details very basic support here... --- tailbone/templates/products/view.mako | 1 + tailbone/views/products.py | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/tailbone/templates/products/view.mako b/tailbone/templates/products/view.mako index e6c12355..d734bb41 100644 --- a/tailbone/templates/products/view.mako +++ b/tailbone/templates/products/view.mako @@ -124,6 +124,7 @@ ${form.render_field_readonly('regular_price')} ${form.render_field_readonly('current_price')} ${form.render_field_readonly('current_price_ends')} + ${form.render_field_readonly('suggested_price')} ${form.render_field_readonly('deposit_link')} ${form.render_field_readonly('tax')} diff --git a/tailbone/views/products.py b/tailbone/views/products.py index e99ca2fb..c5ea6de7 100644 --- a/tailbone/views/products.py +++ b/tailbone/views/products.py @@ -115,6 +115,7 @@ class ProductsView(MasterView): 'category', 'family', 'report_code', + 'suggested_price', 'regular_price', 'current_price', 'current_price_ends', @@ -348,6 +349,13 @@ class ProductsView(MasterView): else: f.remove_field('unit') + # suggested_price + if self.creating: + f.remove_field('suggested_price') + else: + f.set_readonly('suggested_price') + f.set_renderer('suggested_price', self.render_price) + # regular_price if self.creating: f.remove_field('regular_price')