From e930199f83183ef3e82ca64962f5e53b9b3ce687 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 11 Sep 2023 17:13:07 -0500 Subject: [PATCH] Avoid legacy logic for `Customer.people` schema --- tailbone/views/customers.py | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/tailbone/views/customers.py b/tailbone/views/customers.py index 078cda58..0860fc31 100644 --- a/tailbone/views/customers.py +++ b/tailbone/views/customers.py @@ -146,16 +146,8 @@ class CustomerView(MasterView): query = super().query(session) app = self.get_rattail_app() model = self.model - if app.get_clientele_handler().should_use_legacy_people(): - query = query.outerjoin(model.CustomerPerson, - sa.and_( - model.CustomerPerson.customer_uuid == model.Customer.uuid, - model.CustomerPerson.ordinal == 1))\ - .outerjoin(model.Person, - model.Person.uuid == model.CustomerPerson.person_uuid) - else: - query = query.outerjoin(model.Person, - model.Person.uuid == model.Customer.account_holder_uuid) + query = query.outerjoin(model.Person, + model.Person.uuid == model.Customer.account_holder_uuid) return query def configure_grid(self, g): @@ -163,7 +155,6 @@ class CustomerView(MasterView): app = self.get_rattail_app() model = self.model route_prefix = self.get_route_prefix() - legacy = app.get_clientele_handler().should_use_legacy_people() # customer key field = self.get_customer_key_field() @@ -203,17 +194,7 @@ class CustomerView(MasterView): # person g.set_renderer('person', self.grid_render_person) - if legacy: - LegacyPerson = orm.aliased(model.Person) - g.set_joiner('person', lambda q: - q.outerjoin(model.CustomerPerson, - sa.and_( - model.CustomerPerson.customer_uuid == model.Customer.uuid, - model.CustomerPerson.ordinal == 1))\ - .outerjoin(LegacyPerson)) - g.set_sorter('person', LegacyPerson.display_name) - else: - g.set_sorter('person', model.Person.display_name) + g.set_sorter('person', model.Person.display_name) # active_in_pos if self.get_expose_active_in_pos():