Improve default behavior for receiving a purchase batch
only targeting desktop so far, mobile is next...
This commit is contained in:
parent
e6144ea08b
commit
a5d1eece71
3 changed files with 151 additions and 42 deletions
|
@ -310,6 +310,17 @@ class PurchaseView(MasterView):
|
|||
# department
|
||||
f.set_renderer('department', self.render_row_department)
|
||||
|
||||
# product
|
||||
f.set_renderer('product', self.render_row_product)
|
||||
|
||||
def render_row_product(self, row, field):
|
||||
product = row.product
|
||||
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 render_row_department(self, row, field):
|
||||
return "{} {}".format(row.department_number, row.department_name)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue