From 1ec511b60c36f9497ce9898235e535e69fc93153 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Tue, 31 Mar 2020 14:12:35 -0500 Subject: [PATCH] Avoid "physical location" product field, if underlying table is missing --- tailbone_corepos/views/corepos/products.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tailbone_corepos/views/corepos/products.py b/tailbone_corepos/views/corepos/products.py index 9a4250e..eb1ff7c 100644 --- a/tailbone_corepos/views/corepos/products.py +++ b/tailbone_corepos/views/corepos/products.py @@ -25,6 +25,7 @@ CORE-POS product views """ from corepos.db.office_op import model as corepos +from corepos.db.util import table_exists from webhelpers2.html import HTML @@ -90,6 +91,9 @@ class ProductView(CoreOfficeMasterView): def configure_form(self, f): super(ProductView, self).configure_form(f) + if not table_exists(self.Session(), corepos.FloorSection): + f.remove('physical_location') + f.set_renderer('vendor', self.render_corepos_vendor) f.set_renderer('flags', self.render_flags)