Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

How to increase the number of search propositions in partner search ?

By
Anne-Sylvie Burri
on 11/11/13, 3:26 AM 847 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

1
Anne-Sylvie Burri
On 11/12/13, 11:24 AM

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.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 11/11/13, 3:26 AM
Seen: 847 times
Last updated: 3/16/15, 8:10 AM