Display the Store field for Customer Orders

This commit is contained in:
Lance Edgar 2021-09-25 18:55:53 -04:00
parent 3ece3303db
commit 8095f2c9ea
3 changed files with 20 additions and 1 deletions

View file

@ -747,6 +747,13 @@ class MasterView(View):
return obj.upc.pretty() if obj.upc else ''
return getattr(obj, product_key)
def render_store(self, obj, field):
store = getattr(obj, field)
if store:
text = "({}) {}".format(store.id, store.name)
url = self.request.route_url('stores.view', uuid=store.uuid)
return tags.link_to(text, url)
def render_product(self, obj, field):
product = getattr(obj, field)
if not product: