Use standard xref buttons for CORE record views
This commit is contained in:
		
							parent
							
								
									3c28c80074
								
							
						
					
					
						commit
						01afff93bf
					
				
					 7 changed files with 13 additions and 26 deletions
				
			
		| 
						 | 
				
			
			@ -1,3 +0,0 @@
 | 
			
		|||
## -*- coding: utf-8; -*-
 | 
			
		||||
<%inherit file="/core-pos/master/view.mako" />
 | 
			
		||||
${parent.body()}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,3 +0,0 @@
 | 
			
		|||
## -*- coding: utf-8; -*-
 | 
			
		||||
<%inherit file="/core-pos/master/view.mako" />
 | 
			
		||||
${parent.body()}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,3 +0,0 @@
 | 
			
		|||
## -*- coding: utf-8; -*-
 | 
			
		||||
<%inherit file="/core-pos/master/view.mako" />
 | 
			
		||||
${parent.body()}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,11 +0,0 @@
 | 
			
		|||
## -*- coding: utf-8; -*-
 | 
			
		||||
<%inherit file="/master/view.mako" />
 | 
			
		||||
<%namespace file="/corepos-util.mako" import="render_xref_helper" />
 | 
			
		||||
 | 
			
		||||
<%def name="object_helpers()">
 | 
			
		||||
  ${parent.object_helpers()}
 | 
			
		||||
  ${render_xref_helper()}
 | 
			
		||||
</%def>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
${parent.body()}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,3 +0,0 @@
 | 
			
		|||
## -*- coding: utf-8; -*-
 | 
			
		||||
<%inherit file="/core-pos/master/view.mako" />
 | 
			
		||||
${parent.body()}
 | 
			
		||||
| 
						 | 
				
			
			@ -1,3 +0,0 @@
 | 
			
		|||
## -*- coding: utf-8; -*-
 | 
			
		||||
<%inherit file="/core-pos/master/view.mako" />
 | 
			
		||||
${parent.body()}
 | 
			
		||||
| 
						 | 
				
			
			@ -137,6 +137,19 @@ class CoreMasterView(MasterView):
 | 
			
		|||
 | 
			
		||||
        return kwargs
 | 
			
		||||
 | 
			
		||||
    def get_xref_buttons(self, obj):
 | 
			
		||||
        buttons = super().get_xref_buttons(obj)
 | 
			
		||||
        app = self.get_rattail_app()
 | 
			
		||||
        corepos = app.get_corepos_handler()
 | 
			
		||||
 | 
			
		||||
        office_url = corepos.get_office_url()
 | 
			
		||||
        if office_url:
 | 
			
		||||
            url = self.core_office_object_url(office_url, obj)
 | 
			
		||||
            if url:
 | 
			
		||||
                buttons.append(self.make_xref_button(text="View in CORE Office", url=url))
 | 
			
		||||
 | 
			
		||||
        return buttons
 | 
			
		||||
 | 
			
		||||
    def core_office_object_url(self, office_url, obj):
 | 
			
		||||
        """
 | 
			
		||||
        Subclass must define this logic; should return the "final" CORE Office
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue