diff --git a/tailbone/views/batch/core.py b/tailbone/views/batch/core.py index 3ca566d3..dce333bb 100644 --- a/tailbone/views/batch/core.py +++ b/tailbone/views/batch/core.py @@ -306,7 +306,7 @@ class BatchMasterView(MasterView): return True def redirect_after_create(self, batch): - if self.handler.requires_prefill(batch): + if self.handler.should_populate(batch): return self.redirect(self.get_action_url('prefill', batch)) elif self.refresh_after_create: return self.redirect(self.get_action_url('refresh', batch)) @@ -501,7 +501,7 @@ class BatchMasterView(MasterView): session = RattailSession() batch = session.query(self.model_class).get(batch_uuid) try: - self.handler.make_initial_rows(batch, progress=progress) + self.handler.populate(batch, progress=progress) except Exception as error: session.rollback() log.warning("batch pre-fill failed: {}".format(batch), exc_info=True) diff --git a/tailbone/views/products.py b/tailbone/views/products.py index b06e8ce9..55b4dfdf 100644 --- a/tailbone/views/products.py +++ b/tailbone/views/products.py @@ -494,7 +494,7 @@ class ProductsView(MasterView): params['created_by'] = user batch = handler.make_batch(session, **params) batch.products = products.with_session(session).all() - handler.make_initial_rows(batch, progress=progress) + handler.populate(batch, progress=progress) session.commit() session.refresh(batch) diff --git a/tailbone/views/purchases/batch.py b/tailbone/views/purchases/batch.py index c875239c..df5c9a55 100644 --- a/tailbone/views/purchases/batch.py +++ b/tailbone/views/purchases/batch.py @@ -943,8 +943,8 @@ 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) + if self.handler.should_populate(batch): + self.handler.populate(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'))