3
0
Fork 0

fix: only show "create row" button if batch view supports it

This commit is contained in:
Lance Edgar 2026-01-02 19:23:57 -06:00
parent fa2a90c9cc
commit 90784cecb2
2 changed files with 2 additions and 1 deletions

View file

@ -445,7 +445,7 @@ class BatchMasterView(MasterView):
g.set_renderer("status_code", self.render_row_status)
# tool button - create row
if not batch.executed and self.has_perm("create_row"):
if self.rows_creatable and not batch.executed and self.has_perm("create_row"):
button = self.make_button(
f"New {self.get_row_model_title()}",
primary=True,

View file

@ -442,6 +442,7 @@ class TestBatchMasterView(WebTestCase):
mod.BatchMasterView,
model_class=MockBatch,
route_prefix="mock_batches",
rows_creatable=True,
create=True,
):
with patch.object(