Redirect to custom index URL when user cancels new custorder entry

This commit is contained in:
Lance Edgar 2022-08-14 15:53:43 -05:00
parent 303eba6bca
commit a20eb468df

View file

@ -410,8 +410,7 @@ class CustomerOrderView(MasterView):
self.request.session.flash("New customer order has been deleted.") self.request.session.flash("New customer order has been deleted.")
# send user back to customer orders page, w/ no new batch generated # send user back to customer orders page, w/ no new batch generated
route_prefix = self.get_route_prefix() url = self.get_index_url()
url = self.request.route_url(route_prefix)
return self.redirect(url) return self.redirect(url)
def customer_autocomplete(self): def customer_autocomplete(self):
@ -1005,5 +1004,12 @@ class CustomerOrderView(MasterView):
CustomerOrdersView = CustomerOrderView CustomerOrdersView = CustomerOrderView
def includeme(config): def defaults(config, **kwargs):
base = globals()
CustomerOrderView = kwargs.get('CustomerOrderView', base['CustomerOrderView'])
CustomerOrderView.defaults(config) CustomerOrderView.defaults(config)
def includeme(config):
defaults(config)