Populate data rows for new mobile purchasing batch, if applicable

i.e. if batch is meant for receiving an existing PO etc.
This commit is contained in:
Lance Edgar 2017-05-18 11:47:58 -05:00
parent f0feefc7e5
commit cb39ca7970

View file

@ -943,7 +943,10 @@ class PurchaseBatchView(BatchMasterView):
batch.created_by = self.request.user
kwargs = self.get_batch_kwargs(batch, mobile=True)
batch = self.handler.make_batch(self.Session(), **kwargs)
if self.handler.requires_prefill(batch):
self.handler.make_initial_rows(batch)
self.request.session.flash("Created new purchasing batch: {}".format(batch))
# TODO: redirect to mobile receiving view etc. instead
return self.redirect(self.request.route_url('purchases.batch.mobile_create'))
data['mode_title'] = self.enum.PURCHASE_BATCH_MODE[mode].capitalize()