Tweak how batch handler is invoked to remove row
also, removes some related logic which now lives in handler
This commit is contained in:
parent
c78d6f2104
commit
d0b1cb527e
|
@ -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):
|
||||
"""
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue