diff --git a/tailbone/views/batch.py b/tailbone/views/batch.py index a7baac63..849b2ba5 100644 --- a/tailbone/views/batch.py +++ b/tailbone/views/batch.py @@ -404,8 +404,10 @@ class BatchCrud(BaseCrud): override this, but :meth:`configure_fieldset()` instead. """ fs = self.make_fieldset(model) - fs.created.set(renderer=DateTimeFieldRenderer(self.request.rattail_config)) - fs.created_by.set(label="Created by", renderer=UserFieldRenderer) + fs.created.set(renderer=DateTimeFieldRenderer(self.request.rattail_config), + readonly=True) + fs.created_by.set(label="Created by", renderer=UserFieldRenderer, + readonly=True) fs.cognized.set(renderer=DateTimeFieldRenderer(self.request.rattail_config)) fs.cognized_by.set(label="Cognized by", renderer=UserFieldRenderer) fs.executed.set(renderer=DateTimeFieldRenderer(self.request.rattail_config)) @@ -422,6 +424,13 @@ class BatchCrud(BaseCrud): del fs.executed if 'executed_by' in fs.render_fields: del fs.executed_by + else: + batch = fs.model + if not batch.executed: + if 'executed' in fs.render_fields: + del fs.executed + if 'executed_by' in fs.render_fields: + del fs.executed_by return fs def configure_fieldset(self, fieldset):