misc: don't include "enable" action on readonly forms (#4960)

This commit is contained in:
Frédéric Péters 2020-09-15 17:05:20 +02:00
parent f7c1315323
commit a42f6aa10c
1 changed files with 2 additions and 0 deletions

View File

@ -142,6 +142,8 @@ class FieldsDirectory(FieldsDirectory):
readonly_message = N_('This form is readonly.')
def index_bottom(self):
if self.objectdef.is_readonly():
return
if hasattr(self.objectdef, str('disabled')) and self.objectdef.disabled:
r = TemplateIO(html=True)
r += htmltext('<div class="warningnotice">')