From 60222c4977d6beb89ceb8c650fc4a436f5d29b2a Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Tue, 7 Dec 2021 19:58:11 -0600 Subject: [PATCH] Assume default receiving workflow if there is only one --- tailbone/views/purchasing/receiving.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tailbone/views/purchasing/receiving.py b/tailbone/views/purchasing/receiving.py index ccc97d9a..1be9df49 100644 --- a/tailbone/views/purchasing/receiving.py +++ b/tailbone/views/purchasing/receiving.py @@ -291,6 +291,8 @@ class ReceivingBatchView(PurchasingBatchView): else: form.set_widget('workflow', forms.widgets.JQuerySelectWidget(values=values)) + if len(workflows) == 1: + form.set_default('workflow', workflows[0]['workflow_key']) form.submit_label = "Continue" form.cancel_url = self.get_index_url() @@ -753,8 +755,8 @@ class ReceivingBatchView(PurchasingBatchView): # flag is set, since that batch type is only concerned with receiving batch = self.get_instance() if batch.is_truck_dump_parent() and not batch.truck_dump_children_first: - g.hide_column('cases_ordered') - g.hide_column('units_ordered') + g.remove('cases_ordered', + 'units_ordered') # add "Transform to Unit" action, if appropriate if batch.is_truck_dump_parent(): @@ -771,7 +773,7 @@ class ReceivingBatchView(PurchasingBatchView): # truck_dump_status if not batch.is_truck_dump_parent(): - g.hide_column('truck_dump_status') + g.remove('truck_dump_status') else: g.set_enum('truck_dump_status', model.PurchaseBatchRow.STATUS)