Hide "create new row" link for batches which are marked complete

This commit is contained in:
Lance Edgar 2018-05-23 13:11:32 -05:00
parent 218ac221e5
commit 6d27d0cfba

View file

@ -551,7 +551,7 @@ class BatchMasterView(MasterView):
f.set_label('status_code', "Status") f.set_label('status_code', "Status")
def make_default_row_grid_tools(self, batch): def make_default_row_grid_tools(self, batch):
if self.rows_creatable and not batch.executed: if self.rows_creatable and not batch.executed and not batch.complete:
permission_prefix = self.get_permission_prefix() permission_prefix = self.get_permission_prefix()
if self.request.has_perm('{}.create_row'.format(permission_prefix)): if self.request.has_perm('{}.create_row'.format(permission_prefix)):
link = tags.link_to("Create a new {}".format(self.get_row_model_title()), link = tags.link_to("Create a new {}".format(self.get_row_model_title()),