diff --git a/tailbone/views/labels/batch.py b/tailbone/views/labels/batch.py index acf33d9e..414811f4 100644 --- a/tailbone/views/labels/batch.py +++ b/tailbone/views/labels/batch.py @@ -26,10 +26,13 @@ Views for label batches from __future__ import unicode_literals, absolute_import +import six + from rattail.db import model from webhelpers2.html import HTML, tags +from tailbone import forms from tailbone.views.batch import BatchMasterView @@ -181,6 +184,17 @@ class LabelBatchView(BatchMasterView): else: f.remove_field('product') + # label_profile + if self.editing: + f.replace('label_profile', 'label_profile_uuid') + f.set_label('label_profile_uuid', "Label Type") + profiles = self.Session.query(model.LabelProfile)\ + .filter(model.LabelProfile.visible == True)\ + .order_by(model.LabelProfile.ordinal) + profile_values = [(p.uuid, six.text_type(p)) + for p in profiles] + f.set_widget('label_profile_uuid', forms.widgets.JQuerySelectWidget(values=profile_values)) + def includeme(config): LabelBatchView.defaults(config) diff --git a/tailbone/views/master.py b/tailbone/views/master.py index b727e426..c6e8db19 100644 --- a/tailbone/views/master.py +++ b/tailbone/views/master.py @@ -2450,7 +2450,9 @@ class MasterView(View): 'parent_instance': parent, 'instance_title': self.get_row_instance_title(row), 'instance_deletable': self.row_deletable(row), - 'form': form}) + 'form': form, + 'dform': form.make_deform_form(), + }) def mobile_edit_row(self): """