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
|
@ -28,11 +28,14 @@ from __future__ import unicode_literals, absolute_import
|
|||
|
||||
import datetime
|
||||
|
||||
import six
|
||||
from sqlalchemy import orm
|
||||
|
||||
from rattail.db import model
|
||||
from rattail.time import localtime
|
||||
|
||||
from webhelpers2.html import tags
|
||||
|
||||
from tailbone.views import MasterView
|
||||
from tailbone.util import raw_datetime
|
||||
|
||||
|
@ -166,14 +169,6 @@ class CustomerOrderItemsView(MasterView):
|
|||
url = self.request.route_url('custorders.view', uuid=order.uuid)
|
||||
return tags.link_to(text, url)
|
||||
|
||||
def render_product(self, order, field):
|
||||
product = order.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 get_row_data(self, item):
|
||||
return self.Session.query(model.CustomerOrderItemEvent)\
|
||||
.filter(model.CustomerOrderItemEvent.item == item)\
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue