Add MasterView.render_product(), fix edit for pricing batch row

This commit is contained in:
Lance Edgar 2018-10-23 17:20:47 -05:00
parent b9da7e1b12
commit 2bd107056c
7 changed files with 30 additions and 35 deletions

View file

@ -692,7 +692,7 @@ class PurchasingBatchView(BatchMasterView):
f.set_readonly('upc')
f.set_readonly('item_id')
f.set_readonly('product')
f.set_renderer('product', self.render_row_product)
f.set_renderer('product', self.render_product)
# TODO: what's up with this again?
# f.remove_fields('po_total',
@ -704,18 +704,10 @@ class PurchasingBatchView(BatchMasterView):
f.remove_fields('brand_name',
'description',
'size')
f.set_renderer('product', self.render_row_product)
f.set_renderer('product', self.render_product)
else:
f.remove_field('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 configure_mobile_row_form(self, f):
super(PurchasingBatchView, self).configure_mobile_row_form(f)
# row = f.model_instance