Use new pattern for adding link to view customer in CORE Office
This commit is contained in:
		
							parent
							
								
									8606b580df
								
							
						
					
					
						commit
						b896e30409
					
				
					 1 changed files with 10 additions and 7 deletions
				
			
		|  | @ -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() | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lance Edgar
						Lance Edgar