Declare "from PO" receiving workflow if applicable, in API

This commit is contained in:
Lance Edgar 2023-08-17 18:12:42 -05:00
parent 90075b3b65
commit a007606863

View file

@ -77,9 +77,15 @@ class ReceivingBatchViews(APIBatchView):
def create_object(self, data):
data = dict(data)
# all about receiving mode here
data['mode'] = self.enum.PURCHASE_BATCH_MODE_RECEIVING
batch = super(ReceivingBatchViews, self).create_object(data)
return batch
# assume "receive from PO" if given a PO key
if data['purchase_key']:
data['receiving_workflow'] = 'from_po'
return super().create_object(data)
def auto_receive(self):
"""