Odoo Help

1

Many2one field issue

By
Ayham
on 3/5/16, 10:53 AM 1,043 views

I have several Many2one fields in a customized module in Odoo 8, they only show 160 records, when I change their type to Many2many they show all records, some of them has less than 500 records, others has less than 800 records, but all of them just provide access to 160 records, for sure there are no domains on fields.

3
Axel Mendoza
On 3/5/16, 7:01 PM

Hi @Ayham

I understand what you are saying because I deal with that some days ago. I don't know the reason for that limit but it's better that way. You could see all the elements records by making any search in the "search more" list filter and after clear the new search filter you will see all the records. I develop an js extension to make it display all the records always and all the many2one get very very slow, so I disable it. Here is the code for some one else that will be ok with the slow performance. This need to be defined in a loaded js file, there is a lot of others examples of how to load it so I just put the code here:

instance.web.DataSet.include({

name_search: function (name, domain, operator, limit) {

limit = 0;

return this._model.call('name_search', {

name: name || '',

args: domain || false,

operator: operator || 'ilike',

context: this._model.context(),

limit: limit || 0

});

},

});

@Axel Thanks dear, it's like what you said, and your code is work like a magic without effecting the performance, I don't know how to convert your answer as the right solution, or I don't have enough Karma to do that, thanks a lot.

Ayham
on 3/6/16, 10:53 AM

By clicking on the buttons like on the image

Axel Mendoza
on 3/6/16, 11:01 AM

Accepted & upvoted! Nice answer Axel.

Yenthe
on 3/7/16, 5:01 AM

Thanks!!

Axel Mendoza
on 3/7/16, 1:54 PM

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)

Stats

Asked: 3/5/16, 10:53 AM
Seen: 1043 times
Last updated: 3/7/16, 5:01 AM