Allow direct creation of new label batches

now technically this is allowed on desktop, but probably makes more
sense on mobile via api
This commit is contained in:
Lance Edgar 2021-05-18 12:36:46 -05:00
parent 949b9d64bf
commit d1a35a4d58
2 changed files with 9 additions and 5 deletions

View file

@ -48,7 +48,6 @@ class LabelBatchView(BatchMasterView):
route_prefix = 'labels.batch'
url_prefix = '/labels/batches'
template_prefix = '/batch/labels'
creatable = False
bulk_deletable = True
rows_editable = True
rows_bulk_deletable = True
@ -116,12 +115,15 @@ class LabelBatchView(BatchMasterView):
super(LabelBatchView, self).configure_form(f)
# handheld_batches
f.set_readonly('handheld_batches')
f.set_renderer('handheld_batches', self.render_handheld_batches)
if self.viewing or self.deleting:
if self.creating:
f.remove('handheld_batches')
else:
batch = self.get_instance()
if not batch._handhelds:
f.remove_field('handheld_batches')
else:
f.set_readonly('handheld_batches')
f.set_renderer('handheld_batches', self.render_handheld_batches)
# label profile
if self.creating or self.editing: