From 5cfe69d24b4c4ade1384687ad338b2c9664de679 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 23 Aug 2019 22:05:09 -0500 Subject: [PATCH] Hopefully fix "single store" behavior when make a new ordering batch this does seem to fix for this use case, but previous commit for this code implied that it was fixing something for the receiving use case... --- tailbone/views/purchasing/batch.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tailbone/views/purchasing/batch.py b/tailbone/views/purchasing/batch.py index d1bcd144..bbf72db1 100644 --- a/tailbone/views/purchasing/batch.py +++ b/tailbone/views/purchasing/batch.py @@ -254,18 +254,15 @@ class PurchasingBatchView(BatchMasterView): f.replace('store', 'store_uuid') if single_store: store = self.rattail_config.get_store(self.Session()) - f.set_widget('store_uuid', forms.widgets.ReadonlyWidget()) + f.set_widget('store_uuid', dfwidget.HiddenWidget()) f.set_default('store_uuid', store.uuid) f.set_hidden('store_uuid') else: f.set_widget('store_uuid', dfwidget.SelectWidget(values=self.get_store_values())) f.set_label('store_uuid', "Store") else: - if single_store: - f.remove_field('store') - else: - f.set_readonly('store') - f.set_renderer('store', self.render_store) + f.set_readonly('store') + f.set_renderer('store', self.render_store) # purchase f.set_renderer('purchase', self.render_purchase)