(self, xml_id, route_name)
return route
return a route record set from an xml_id or its name.
return a route record set from an xml_id or its name.
return a route record set from an xml_id or its name .
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
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