Don't allow row deletion if batch is marked complete
This commit is contained in:
parent
3d79f9fd7d
commit
630ffe0cf8
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue