Don't allow row deletion if batch is marked complete

This commit is contained in:
Lance Edgar 2018-02-22 12:26:21 -06:00
parent 3d79f9fd7d
commit 630ffe0cf8

View file

@ -818,18 +818,18 @@ class BatchMasterView(MasterView):
def row_editable(self, row):
"""
Batch rows are editable only until batch has been executed.
Batch rows are editable only until batch is complete or executed.
"""
batch = self.get_parent(row)
return self.rows_editable and not batch.executed and not batch.complete
def row_deletable(self, row):
"""
Batch rows are deletable only until batch has been executed.
Batch rows are deletable only until batch is complete or executed.
"""
if self.rows_deletable:
batch = self.get_parent(row)
if not batch.executed:
if not batch.executed and not batch.complete:
return True
return False