Add 'discontinued' flag to product view

Also, don't render product description as link if it's empty
This commit is contained in:
Lance Edgar 2017-03-03 15:08:00 -08:00
parent 2002031e41
commit b3599d8241
2 changed files with 3 additions and 1 deletions

View file

@ -59,6 +59,7 @@
${render_field_readonly(form.fieldset.special_order)} ${render_field_readonly(form.fieldset.special_order)}
${render_field_readonly(form.fieldset.organic)} ${render_field_readonly(form.fieldset.organic)}
${render_field_readonly(form.fieldset.not_for_sale)} ${render_field_readonly(form.fieldset.not_for_sale)}
${render_field_readonly(form.fieldset.discontinued)}
${render_field_readonly(form.fieldset.deleted)} ${render_field_readonly(form.fieldset.deleted)}
</%def> </%def>

View file

@ -82,7 +82,7 @@ class DescriptionFieldRenderer(fa.TextFieldRenderer):
description = self.raw_value description = self.raw_value
if description is None: if description is None:
return '' return ''
if kwargs.get('link'): if kwargs.get('link') and description:
product = self.field.parent.model product = self.field.parent.model
description = tags.link_to(description, kwargs['link'](product)) description = tags.link_to(description, kwargs['link'](product))
return description return description
@ -314,6 +314,7 @@ class ProductsView(MasterView):
fs.not_for_sale, fs.not_for_sale,
fs.ingredients, fs.ingredients,
fs.notes, fs.notes,
fs.discontinued,
fs.deleted, fs.deleted,
fs.last_sold, fs.last_sold,
]) ])