Add MasterView.render_product()
, fix edit for pricing batch row
This commit is contained in:
parent
b9da7e1b12
commit
2bd107056c
7 changed files with 30 additions and 35 deletions
|
@ -731,6 +731,14 @@ class MasterView(View):
|
|||
return obj.upc.pretty() if obj.upc else ''
|
||||
return getattr(obj, product_key)
|
||||
|
||||
def render_product(self, obj, field):
|
||||
product = getattr(obj, field)
|
||||
if not product:
|
||||
return ""
|
||||
text = six.text_type(product)
|
||||
url = self.request.route_url('products.view', uuid=product.uuid)
|
||||
return tags.link_to(text, url)
|
||||
|
||||
def before_create_flush(self, obj, form):
|
||||
pass
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue