diff --git a/tailbone_corepos/views/people.py b/tailbone_corepos/views/people.py index 9cd6705..f996aef 100644 --- a/tailbone_corepos/views/people.py +++ b/tailbone_corepos/views/people.py @@ -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()