odoo-13.0/addons/base_import/static/src/js/import_action.js
/**
 * query returns a list of suggestion select2 objects, this function:
 *
 * * returns data exactly matching query by either id or text if those exist
 * * otherwise it returns a select2 option matching the term and any data
 *   option whose id or text matches (by substring)
 */
query returns a list of suggestion select2 objects, this function:
returns data exactly matching query by either id or text if those exist
otherwise it returns a select2 option matching the term and any data
option whose id or text matches (by substring)
query returns a list of suggestion select2 objects this function : returns data exactly matching query by either id or text if those exist otherwise it returns a select2 option matching the term and any data option whose id or text matches ( by substring )
function dataFilteredQuery(q) {
    var suggestions = _.clone(this.data);
    if (q.term) {
        var exact = _.filter(suggestions, function (s) {
            return s.id === q.term || s.text === q.term;
        });
        if (exact.length) {
            suggestions = exact;
        } else {
            suggestions = [_make_option(q.term)].concat(_.filter(suggestions, function (s) {
                return s.id.indexOf(q.term) !== -1 || s.text.indexOf(q.term) !== -1
            }));
        }
    }
    q.callback({results: suggestions});
}
function dataFilteredQuery ( q ) { var suggestions = _ . clone ( this . data ) ; if ( q . term ) { var exact = _ . filter ( suggestions , function ( s ) { return s . id === q . term || s . text === q . term ; } ) ; if ( exact . length ) { suggestions = exact ; } else { suggestions = [ _make_option ( q . term ) ] . concat ( _ . filter ( suggestions , function ( s ) { return s . id . indexOf ( q . term ) !== - 1 || s . text . indexOf ( q . term ) !== - 1 } ) ) ; } } q . callback ( { results : suggestions } ) ; }
query returns a list of suggestion select2 objects, this function:
 * returns data exactly matching query by either id or text if those exist
 * otherwise it returns a select2 option matching the term and any data
   option whose id or text matches (by substring)
query returns a list of suggestion select2 objects this function : * returns data exactly matching query by either id or text if those exist * otherwise it returns a select2 option matching the term and any data option whose id or text matches ( by substring )