Include shopper history from parent customer account perspective
..right? or should this be hidden? configurable etc.?
This commit is contained in:
parent
b2aea57da6
commit
8be7dac33b
|
@ -1283,6 +1283,22 @@ class PersonView(MasterView):
|
||||||
.filter(cls.account_holder_uuid == person.uuid)
|
.filter(cls.account_holder_uuid == person.uuid)
|
||||||
versions.extend(query.all())
|
versions.extend(query.all())
|
||||||
|
|
||||||
|
# CustomerShopper (from Customer perspective)
|
||||||
|
cls = continuum.version_class(model.CustomerShopper)
|
||||||
|
query = self.Session.query(cls)\
|
||||||
|
.join(model.Customer, model.Customer.uuid == cls.customer_uuid)\
|
||||||
|
.filter(model.Customer.account_holder_uuid == person.uuid)
|
||||||
|
versions.extend(query.all())
|
||||||
|
|
||||||
|
# CustomerShopperHistory (from Customer perspective)
|
||||||
|
cls = continuum.version_class(model.CustomerShopperHistory)
|
||||||
|
query = self.Session.query(cls)\
|
||||||
|
.join(model.CustomerShopper,
|
||||||
|
model.CustomerShopper.uuid == cls.shopper_uuid)\
|
||||||
|
.join(model.Customer)\
|
||||||
|
.filter(model.Customer.account_holder_uuid == person.uuid)
|
||||||
|
versions.extend(query.all())
|
||||||
|
|
||||||
# CustomerShopper (from Shopper perspective)
|
# CustomerShopper (from Shopper perspective)
|
||||||
cls = continuum.version_class(model.CustomerShopper)
|
cls = continuum.version_class(model.CustomerShopper)
|
||||||
query = self.Session.query(cls)\
|
query = self.Session.query(cls)\
|
||||||
|
|
Loading…
Reference in a new issue