Use new pattern for adding link to view customer in CORE Office
This commit is contained in:
parent
8606b580df
commit
b896e30409
|
@ -57,13 +57,16 @@ class PersonViewSupplement(ViewSupplement):
|
||||||
model = self.model
|
model = self.model
|
||||||
return [model.CorePerson]
|
return [model.CorePerson]
|
||||||
|
|
||||||
def get_customer_xref_buttons(self, person):
|
def get_context_for_customer(self, customer, context):
|
||||||
buttons = []
|
|
||||||
for customer in person.customers:
|
if customer.corepos_card_number:
|
||||||
url = core_office_customer_account_url(
|
url = core_office_customer_account_url(self.rattail_config,
|
||||||
self.rattail_config, customer.number)
|
customer.corepos_card_number)
|
||||||
buttons.append({'url': url, 'text': "View in CORE Office"})
|
if url:
|
||||||
return buttons
|
context['external_links'].append({'label': "View in CORE Office",
|
||||||
|
'url': url})
|
||||||
|
|
||||||
|
return context
|
||||||
|
|
||||||
def get_member_xref_buttons(self, person):
|
def get_member_xref_buttons(self, person):
|
||||||
buttons = OrderedDict()
|
buttons = OrderedDict()
|
||||||
|
|
Loading…
Reference in a new issue