Use new pattern for adding link to view customer in CORE Office

This commit is contained in:
Lance Edgar 2023-06-10 20:14:20 -05:00
parent 8606b580df
commit b896e30409

View file

@ -57,13 +57,16 @@ class PersonViewSupplement(ViewSupplement):
model = self.model
return [model.CorePerson]
def get_customer_xref_buttons(self, person):
buttons = []
for customer in person.customers:
url = core_office_customer_account_url(
self.rattail_config, customer.number)
buttons.append({'url': url, 'text': "View in CORE Office"})
return buttons
def get_context_for_customer(self, customer, context):
if customer.corepos_card_number:
url = core_office_customer_account_url(self.rattail_config,
customer.corepos_card_number)
if url:
context['external_links'].append({'label': "View in CORE Office",
'url': url})
return context
def get_member_xref_buttons(self, person):
buttons = OrderedDict()