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