Add (restore?) basic support for mobile receiving from PO

This commit is contained in:
Lance Edgar 2018-07-18 16:25:54 -05:00
parent 87ba8026e5
commit 34bdd2ac84
5 changed files with 122 additions and 67 deletions

View file

@ -560,9 +560,11 @@ class PurchasingBatchView(BatchMasterView):
if self.batch_mode in (self.enum.PURCHASE_BATCH_MODE_RECEIVING,
self.enum.PURCHASE_BATCH_MODE_COSTING):
if batch.purchase_uuid:
purchase = batch.purchase
if not purchase and batch.purchase_uuid:
purchase = self.Session.query(model.Purchase).get(batch.purchase_uuid)
assert purchase
if purchase:
kwargs['purchase'] = purchase
kwargs['buyer'] = purchase.buyer
kwargs['buyer_uuid'] = purchase.buyer_uuid