Do not allow executing custorder if no customer is set
or really any reason, as defined by handler
This commit is contained in:
parent
a11be5a1e1
commit
a9e9474f5c
|
@ -956,6 +956,11 @@ class CustomerOrderView(MasterView):
|
|||
'batch': self.normalize_batch(batch)}
|
||||
|
||||
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:
|
||||
result = self.execute_new_order_batch(batch, data)
|
||||
except Exception as error:
|
||||
|
|
Loading…
Reference in a new issue