Avoid "physical location" product field, if underlying table is missing

This commit is contained in:
Lance Edgar 2020-03-31 14:12:35 -05:00
parent 41ce64b67f
commit 1ec511b60c

View file

@ -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)