From 57c2a7981f6ec24466b954e6ff5f990d9b4a8c8a Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 23 May 2018 14:13:28 -0500 Subject: [PATCH] Fix some things for inventory batch views --- tailbone/views/batch/core.py | 4 +++- tailbone/views/inventory.py | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tailbone/views/batch/core.py b/tailbone/views/batch/core.py index 5158624f..d7c3794c 100644 --- a/tailbone/views/batch/core.py +++ b/tailbone/views/batch/core.py @@ -445,7 +445,9 @@ class BatchMasterView(MasterView): def toggle_complete(self): batch = self.get_instance() - if not batch.executed: + if batch.executed: + self.request.session.flash("Request ignored, since batch has already been executed") + else: form = forms.Form(schema=ToggleComplete(), request=self.request) if form.validate(newstyle=True): batch.complete = form.validated['complete'] diff --git a/tailbone/views/inventory.py b/tailbone/views/inventory.py index f3252d57..976ed823 100644 --- a/tailbone/views/inventory.py +++ b/tailbone/views/inventory.py @@ -194,9 +194,6 @@ class InventoryBatchView(BatchMasterView): batch.created_by, localtime(self.request.rattail_config, batch.created, from_utc=True).strftime('%Y-%m-%d')) - def editable_instance(self, batch): - return True - def mutable_batch(self, batch): return not batch.executed and not batch.complete and batch.mode != self.enum.INVENTORY_MODE_ZERO_ALL