Do not allow executing custorder if no customer is set

or really any reason, as defined by handler
This commit is contained in:
Lance Edgar 2023-09-26 09:32:57 -05:00
parent a11be5a1e1
commit a9e9474f5c

View file

@ -956,6 +956,11 @@ class CustomerOrderView(MasterView):
'batch': self.normalize_batch(batch)} 'batch': self.normalize_batch(batch)}
def submit_new_order(self, batch, data): def submit_new_order(self, batch, data):
reason = self.batch_handler.why_not_execute(batch, user=self.request.user)
if reason:
return {'error': reason}
try: try:
result = self.execute_new_order_batch(batch, data) result = self.execute_new_order_batch(batch, data)
except Exception as error: except Exception as error: