Fix product URL for a new custorder scenario
This commit is contained in:
parent
5d875bc731
commit
3990854d42
|
@ -527,6 +527,7 @@
|
|||
type="is-primary"
|
||||
tag="a" target="_blank"
|
||||
:href="productURL"
|
||||
:disabled="!productURL"
|
||||
icon-pack="fas"
|
||||
icon-left="external-link-alt">
|
||||
View Product
|
||||
|
@ -1536,8 +1537,7 @@
|
|||
this.productUnitPriceDisplay = selected.unit_price_display
|
||||
this.productCasePriceDisplay = selected.case_price_display
|
||||
this.productImageURL = selected.image_url
|
||||
// TODO: this needs to come from handler i guess..
|
||||
// this.productURL = row.product_url
|
||||
this.productURL = selected.url
|
||||
this.productQuantity = 1
|
||||
this.productUnitChoices = selected.uom_choices
|
||||
// TODO: seems like the default should not be so generic?
|
||||
|
|
|
@ -183,13 +183,17 @@ class CustomerOrderView(MasterView):
|
|||
|
||||
def configure_row_grid(self, g):
|
||||
super(CustomerOrderView, self).configure_row_grid(g)
|
||||
app = self.get_rattail_app()
|
||||
handler = app.get_batch_handler(
|
||||
'custorder',
|
||||
default='rattail.batch.custorder:CustomerOrderBatchHandler')
|
||||
|
||||
g.set_type('case_quantity', 'quantity')
|
||||
g.set_type('order_quantity', 'quantity')
|
||||
g.set_type('cases_ordered', 'quantity')
|
||||
g.set_type('units_ordered', 'quantity')
|
||||
|
||||
if self.handler.product_price_may_be_questionable():
|
||||
if handler.product_price_may_be_questionable():
|
||||
g.set_renderer('total_price', self.render_price_with_confirmation)
|
||||
else:
|
||||
g.set_type('total_price', 'currency')
|
||||
|
|
Loading…
Reference in a new issue