Display "suggested price" when viewing product details

very basic support here...
This commit is contained in:
Lance Edgar 2018-11-08 09:57:27 -06:00
parent bdbb8e2a7d
commit 20e654ddea
2 changed files with 9 additions and 0 deletions

View file

@ -124,6 +124,7 @@
${form.render_field_readonly('regular_price')} ${form.render_field_readonly('regular_price')}
${form.render_field_readonly('current_price')} ${form.render_field_readonly('current_price')}
${form.render_field_readonly('current_price_ends')} ${form.render_field_readonly('current_price_ends')}
${form.render_field_readonly('suggested_price')}
${form.render_field_readonly('deposit_link')} ${form.render_field_readonly('deposit_link')}
${form.render_field_readonly('tax')} ${form.render_field_readonly('tax')}
</%def> </%def>

View file

@ -115,6 +115,7 @@ class ProductsView(MasterView):
'category', 'category',
'family', 'family',
'report_code', 'report_code',
'suggested_price',
'regular_price', 'regular_price',
'current_price', 'current_price',
'current_price_ends', 'current_price_ends',
@ -348,6 +349,13 @@ class ProductsView(MasterView):
else: else:
f.remove_field('unit') 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 # regular_price
if self.creating: if self.creating:
f.remove_field('regular_price') f.remove_field('regular_price')