parameters: (self, xml_id, route_name)
return_statement: return route
docstring: return a route record set from an xml_id or its name.
docstring_summary: return a route record set from an xml_id or its name.
docstring_tokens: return a route record set from an xml_id or its name .
function: def _find_global_route(self, xml_id, route_name):
          """ return a route record set from an xml_id or its name. """
          route = self.env.ref(xml_id, raise_if_not_found=False)
          if not route:
              route = self.env['stock.location.route'].search([('name', 'like', route_name)], limit=1)
          if not route:
              raise UserError(_('Can\'t find any generic route %s.') % (route_name))
          return route
function_tokens: def _find_global_route ( self , xml_id , route_name ) : route = self . env . ref ( xml_id , raise_if_not_found = False ) if not route : route = self . env [ 'stock.location.route' ] . search ( [ ( 'name' , 'like' , route_name ) ] , limit = 1 ) if not route : raise UserError ( _ ( 'Can\'t find any generic route %s.' ) % ( route_name ) ) return route