Don't require department by default, for new purchasing batch

This commit is contained in:
Lance Edgar 2020-08-21 12:28:01 -05:00
parent 58362ae858
commit 7f8271e215

View file

@ -309,7 +309,9 @@ class PurchasingBatchView(BatchMasterView):
f.set_node('department_uuid', colander.String()) f.set_node('department_uuid', colander.String())
dept_options = self.get_department_options() dept_options = self.get_department_options()
dept_values = [(v, k) for k, v in dept_options] dept_values = [(v, k) for k, v in dept_options]
dept_values.insert(0, ('', "(unspecified)"))
f.set_widget('department_uuid', dfwidget.SelectWidget(values=dept_values)) f.set_widget('department_uuid', dfwidget.SelectWidget(values=dept_values))
f.set_required('department_uuid', False)
f.set_label('department_uuid', "Department") f.set_label('department_uuid', "Department")
else: else:
f.set_readonly('department') f.set_readonly('department')