This question has been flagged
1 Reply
2720 Views

Hi everybody,

Someone knows how to increase the number of search propositions in partner search ? I would like to have more than 10 results when I search for example a company.

Thanks in advance.

JMB

Avatar
Discard
Author Best Answer

I found the answer. In file "search.js" (addons/web/static/js) you have to modify "limit" parameter with the number of your choice (by default 8) :

instance.web.search.[wiki:ManyToOneField] = instance.web.search.[wiki:CharField].extend({

  default_operator: {}, init: function (view_section, field, parent) {
    this._super(view_section, field, parent); this.model = new instance.web.Model(this.attrs.relation);
  }, complete: function (needle) {
    var self = this; // FIXME: "concurrent" searches (multiple requests, mis-ordered responses) var context = instance.web.pyeval.eval(
      'contexts', [this.view.dataset.get_context()]);
    return this.model.call('name_search', [], {
      name: needle, args: instance.web.pyeval.eval(
        'domains', this.attrs.domain ? [this.attrs.domain] : [], context),
      limit: 8, context: context
    }).then(function (results) {
      if (_.isEmpty(results)) { return null; } return [{label: self.attrs.string}].concat(
        _(results).map(function (result) {
          return {
            label: result[1] , facet: facet_from(self, result)
          };
        }));
    });
  },

Hope it will be usefull.

Avatar
Discard