Avoid legacy logic for Customer.people
schema
This commit is contained in:
parent
60044d5cdf
commit
e930199f83
|
@ -146,14 +146,6 @@ class CustomerView(MasterView):
|
||||||
query = super().query(session)
|
query = super().query(session)
|
||||||
app = self.get_rattail_app()
|
app = self.get_rattail_app()
|
||||||
model = self.model
|
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,
|
query = query.outerjoin(model.Person,
|
||||||
model.Person.uuid == model.Customer.account_holder_uuid)
|
model.Person.uuid == model.Customer.account_holder_uuid)
|
||||||
return query
|
return query
|
||||||
|
@ -163,7 +155,6 @@ class CustomerView(MasterView):
|
||||||
app = self.get_rattail_app()
|
app = self.get_rattail_app()
|
||||||
model = self.model
|
model = self.model
|
||||||
route_prefix = self.get_route_prefix()
|
route_prefix = self.get_route_prefix()
|
||||||
legacy = app.get_clientele_handler().should_use_legacy_people()
|
|
||||||
|
|
||||||
# customer key
|
# customer key
|
||||||
field = self.get_customer_key_field()
|
field = self.get_customer_key_field()
|
||||||
|
@ -203,16 +194,6 @@ class CustomerView(MasterView):
|
||||||
|
|
||||||
# person
|
# person
|
||||||
g.set_renderer('person', self.grid_render_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
|
# active_in_pos
|
||||||
|
|
Loading…
Reference in a new issue