Declare "from PO" receiving workflow if applicable, in API
This commit is contained in:
parent
90075b3b65
commit
a007606863
|
@ -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):
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue