Filter by receiving mode, for receiving batch API

This commit is contained in:
Lance Edgar 2019-11-19 13:19:37 -06:00
parent d9fecd8eb5
commit bed9ad76f9

View file

@ -55,6 +55,11 @@ class ReceivingBatchViews(APIBatchView):
object_url_prefix = '/receiving-batch' object_url_prefix = '/receiving-batch'
supports_toggle_complete = True supports_toggle_complete = True
def base_query(self):
query = super(ReceivingBatchViews, self).base_query()
query = query.filter(model.PurchaseBatch.mode == self.enum.PURCHASE_BATCH_MODE_RECEIVING)
return query
def normalize(self, batch): def normalize(self, batch):
data = super(ReceivingBatchViews, self).normalize(batch) data = super(ReceivingBatchViews, self).normalize(batch)