Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Why does Product search-view not show all products?

Subscribe

Get notified when there's activity on this post

This question has been flagged
filterproductsearchview
7 Replies
14516 Views
Avatar
Jae Landers

When entering a line on a Sale Order, I click the Search more button and a Product Search view comes up. This search view shows 80 of 160 products. I have about 1200 products loaded into the system. Whatever the logic is that is pulling these 160 items is also effecting default filters applied to that view.

As an example, I set a filter to show all products that have a cost price of 10$ or more which should pull up 502 items, but it only pulls 120 records. If I then un-apply the filter and re-apply it, thien it shows all 502. So, the logic seems to apply when the window is opened, and not at all afterwards. I don't really know where to look for something that would apply in the background, and then disappear...

1
Avatar
Discard
Avatar
Axel Mendoza
Best Answer

I solved this using the following js extension:

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

});

},

});

0
Avatar
Discard
Avatar
Jae Landers
Author Best Answer

After quite a bit of searching and digging around, I found where this is coded in -

addons/web/static/src/js/view_form.js

values.push({

label: _t("Search More..."),

action: function() {

+ dataset.name_search(search_val, self.build_domain(), 'ilike', 160).done(function(data) {

self._search_create_popup("search", data);

});

---------------------

The point which states '160' is the limit of how many items will be pulled up by the Search More window upon initial query. I modified this to be 161 on a dev system just to test and it worked - the list that was pulled up gave me 161 records.

 

Now I need to figure out how to override this as I would rather not mess with the original code.

1
Avatar
Discard
john5000

Kyle, Great that you found that. Very good to know. Here is a link on how to override/extend js code: https://www.odoo.com/forum/help-1/question/how-can-i-extend-a-js-web-module-64

Avatar
john5000
Best Answer

Since this is somewhat hard to track down, one way to check this type of problem is to see what the underlying SQL query is doing. That is simple to view and will shed light on what filters are being applied.

You just need to turn on the postgres logging to show all SQL statements that are run, then do your actions, and then check the postgres log file to see what SQL was run. 

Here is how to enable the logging of SQL statements:

  1. Find your "postgresql.conf" file.  (You can find it by doing the following Query in SQL: "show config_file")
  2. Edit that file and set:
    • log_statement=all   -- usual default is set to "none".
    • OR, other way is to set: log_min_duration_statement = 0
  3. You will need to find out where your log file is. Look for "log_destination" in that same postresql.conf file to help find it. I use the GreenOdoo distro and it logs to /var/odoo8/runtime/psql/logfile
  4. Restart postgresql.

After setting that, do the first product search (also, make sure you are the only user). Then look in the log to see what SQL was executed. There will be a lot of excess SQL which you can skip.  Search for "product_product" or "product_template" which are the tables used for products. From there you can see what filters were appled when quering from the table.

 

0
Avatar
Discard
Avatar
Vasanth
Best Answer

Hi,

In Openerp,they set the limit has 80 or 120.you can set the limit in the super method as

res = super(product_product,self).name_search(cr, uid, name, args=args, operator=operator, context=context, limit=limit)

0
Avatar
Discard
Avatar
Sathors
Best Answer

You can also refer to this Github issue: https://github.com/odoo/odoo/issues/2235

0
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
Search for warehouse inside products tree view
filter product search
Avatar
Avatar
1
Nov 22
2557
Suggestions for global filtering data by company?
filter searchview odoo10
Avatar
Avatar
1
Oct 22
4853
Filter sale.line on product categories give all product in sub-categories.
filter product categories
Avatar
1
Mar 15
5338
[✅ SOLVED] How to extend a XML search filter view and add an additional filter ? Solved
filter searchview xmlview v18
Avatar
Avatar
1
May 25
3355
Search Bar Filter Customization
filter xml searchview searchbar
Avatar
0
Nov 24
1291
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now