diff --git a/tailbone/views/custorders/orders.py b/tailbone/views/custorders/orders.py index 41f7c5f5..cf231374 100644 --- a/tailbone/views/custorders/orders.py +++ b/tailbone/views/custorders/orders.py @@ -924,11 +924,16 @@ class CustomerOrderView(MasterView): if not result: return {'error': "Batch failed to execute"} - next_url = None - if isinstance(result, model.CustomerOrder): - next_url = self.get_action_url('view', result) + return { + 'ok': True, + 'next_url': self.get_next_url_after_submit_new_order(batch, result), + } - return {'ok': True, 'next_url': next_url} + def get_next_url_after_submit_new_order(self, batch, result, **kwargs): + model = self.model + + if isinstance(result, model.CustomerOrder): + return self.get_action_url('view', result) def execute_new_order_batch(self, batch, data): return self.batch_handler.do_execute(batch, self.request.user)