From b30577828f50ebc547bdb0f88af2997135c54843 2018-02-22 12:24:53 From: Lance Edgar Date: 2018-02-22 12:24:53 Subject: [PATCH] Don't consider a batch refreshable if it's marked complete --- diff --git a/rattail/batch/handlers.py b/rattail/batch/handlers.py index 6aee197c32f7d8a83ac06cd23470d3de811b763c..bda4b20245528815518b5a7dde54f80ab8a85a45 100644 --- a/rattail/batch/handlers.py +++ b/rattail/batch/handlers.py @@ -223,13 +223,17 @@ class BatchHandler(object): """ This method should return a boolean indicating whether or not the handler supports a "refresh" operation for the batch, given its current - condition. The default simply returns ``True`` but you may override as - needed. + condition. The default assumes a refresh is allowed unless the batch + is complete or executed. Note that this (currently) only affects the enabled/disabled state of the Refresh button within the Tailbone batch view. """ - return not bool(batch.executed) + if batch.executed: + return False + if batch.complete: + return False + return True def progress_loop(self, *args, **kwargs): return progress_loop(*args, **kwargs)