Fix some things for inventory batch views
This commit is contained in:
parent
62dca3d0b0
commit
57c2a7981f
|
@ -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']
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue