From d0b1cb527e62669a92c6d2fb85f182da4858d25d Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 11 Mar 2019 19:32:41 -0500 Subject: [PATCH] Tweak how batch handler is invoked to remove row also, removes some related logic which now lives in handler --- tailbone/views/batch/core.py | 2 +- tailbone/views/purchasing/batch.py | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/tailbone/views/batch/core.py b/tailbone/views/batch/core.py index 899929bf..3d01db8b 100644 --- a/tailbone/views/batch/core.py +++ b/tailbone/views/batch/core.py @@ -1120,7 +1120,7 @@ class BatchMasterView(MasterView): """ Perform the actual deletion of given row object. """ - self.handler.remove_row(row) + self.handler.do_remove_row(row) def bulk_delete_rows(self): """ diff --git a/tailbone/views/purchasing/batch.py b/tailbone/views/purchasing/batch.py index 1c7ccaba..9bec164d 100644 --- a/tailbone/views/purchasing/batch.py +++ b/tailbone/views/purchasing/batch.py @@ -907,20 +907,6 @@ class PurchasingBatchView(BatchMasterView): parent = self.get_parent(row) return self.redirect(self.get_action_url('view', parent, mobile=mobile)) - def delete_row(self): - """ - Update the batch totals in addition to marking row as removed. - """ - row = self.Session.query(self.model_row_class).get(self.request.matchdict['row_uuid']) - if not row: - raise self.notfound() - batch = row.batch - if row.po_total: - batch.po_total -= row.po_total - if row.invoice_total: - batch.invoice_total -= row.invoice_total - return super(PurchasingBatchView, self).delete_row() - # def get_execute_success_url(self, batch, result, **kwargs): # # if batch execution yielded a Purchase, redirect to it # if isinstance(result, model.Purchase):