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
    • Artificial Intelligence
    • 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
    • Property 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
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

change search behavior

Subscribe

Get notified when there's activity on this post

This question has been flagged
defaultv7searchoperator
16 Replies
17962 Views
Avatar
Andreas Maertens

Hi everybody,

is there a way to change standard search behavior? The users expectations of a search field are different from what OpenERP does as I think. Whenever I confront a user with this behavior he tells me that it's strange.

If I type in search fields stuff like "Mainboard | Asus" I expect to find all names with "Mainboards" and "Asus". You all know I find all Names with "Mainboards" and all Names with "Asus".

I know about the possibility to use advanced searches but changing that behavior will serve customers expectations and make working with openerp easier.

Does anyone knows a way to change that? Couldn't find something in expressions.py or orm.py

Thanks in advance

8
Avatar
Discard
Andreas Maertens
Author

Thanks Ray, that sounds like a handy solution.

Ashmsh.M

how can be change the advance search labels ; eg: Active is changed to Present where did i edit the view

Andreas Maertens
Author

I've found the source handle the "OR" behavior. In "web/addons/web/source/src/js/search.js" search for " if (domains.length === 1) { return domains[0]; } for (var i = domains.length; --i;) { domains.unshift(['|']); }"

Andreas Maertens
Author

Thank you, that looks very interesting.

Dhrupesh Kotadiya

Hello Andres,

You can change search behaviour , override def _search method .

Thanks,

Avatar
Andreas Maertens
Author Best Answer

I could improve search behavior by adding more "search criteria" to the "search.view" In an addon I added following inherited views to improve searches. This is mainly the same as the module of Grover Menacho does but without the dynamic his module provides.

    <record id="rcs_product_search_form" model="ir.ui.view">
        <field name="inherit_id" ref="base.view_res_partner_filter"/>
        <field name="name">res.partner.select</field>
        <field name="model">res.partner</field>
        <field name="arch" type="xml">
            <field name="name" position="before">
               <field name="street2" string="full-text"
                      filter_domain="[
                            '|',('name','ilike',self),
                            '|',('parent_id','ilike',self),
                            '|',('ref','=',self),
                            '|',('street','ilike',self),
                            '|',('street2','ilike',self),
                            '|',('zip','ilike',self),
                            '|',('city','ilike',self),
                            '|',('email','ilike',self),
                            '|',('phone','ilike',self),
                            '|',('fax','ilike',self),
                            '|',('mobile','ilike',self),
                            '|',('lang','ilike',self),
                            '|',('website','ilike',self),
                            '|',('country_id.name','ilike',self),
                            ('ean13','ilike',self)
                            ]" />
            </field>
            <field name="name" position="after">
                <field name="parent_id" filter_domain="[('parent_id','ilike',self)]"/>
                <field name="ref" filter_domain="[('ref','ilike',self)]"/>
                <field name="street" filter_domain="['|',('street','ilike',self),('street2','ilike',self)]"/>
                <field name="zip" filter_domain="[('zip','ilike',self)]"/>
                <field name="city" filter_domain="[('city','ilike',self)]"/>
                <field name="email" filter_domain="[('email','ilike',self)]"/>
                <field name="phone" filter_domain="[('phone','ilike',self)]"/>
                <field name="fax" filter_domain="[('fax','ilike',self)]"/>
                <field name="mobile" filter_domain="[('mobile','ilike',self)]"/>
                <field name="lang" filter_domain="[('lang','ilike',self)]"/>
                <field name="website" filter_domain="[('website','ilike',self)]"/>
                <field name="country_id" filter_domain="[('country_id.name','ilike',self)]"/>
                <field name="ean13" filter_domain="[('ean13','ilike',self)]"/>
            </field>
        </field>
    </record>

and

        <record id="rcs_product_search_form_view" model="ir.ui.view">
        <field name="inherit_id" ref="product.product_search_form_view"/>
        <field name="name">product.search.form</field>
        <field name="model">product.product</field>
        <field name="arch" type="xml">
            <field name="name" position="before">
               <field name="description" string="full-text"
                      filter_domain="[
                            '|',('name','ilike',self),
                            '|',('description','ilike',self),
                            '|',('default_code','ilike',self),
                            '|',('seller_id','ilike',self),
                            '|',('seller_product_code','ilike',self),
                            '|',('description_sale','ilike',self),
                            ('producer_id.name','ilike',self),
                            ]" />
            </field>
            <field name="name" position="after">
                <field name="default_code" filter_domain="[('default_code','ilike',self)]"/>
                <field name="seller_id" filter_domain="[('seller_id','ilike',self)]"/>
                <field name="seller_product_code" filter_domain="[('seller_product_code','ilike',self)]"/>
                <field name="description_sale" filter_domain="[('description_sale','ilike',self)]"/>
                <field name="producer_id" filter_domain="[('producer_id','ilike',self)]"/>
            </field>
        </field>
    </record>
3
Avatar
Discard
Avatar
Simplify it!
Best Answer

Hello.

I'm starting with Launchpad so I'm not sure if I did it well anyways you can find a module that improves search of products here:

https://code.launchpad.net/~hmen/openobject-poiesis/extra-addons-poiesis

I hope this can help you.

2
Avatar
Discard
Andreas Maertens
Author

Thanks for your module. It really improves search a bit and I have some additional ideas, but it doesn't solve the probleme I talked about. The general search still is with an 'and'.

Andreas Maertens
Author

After thinkin about your module I must say it does solve the Problem in a way. It helps me to find arguments for the existing solution in openerp and I think with your model and the standard behavior this may be the optimal solution. ty

Simplify it!

Yes, but I think I misunderstood your requirement, my module helps you to add fields to search but that was not the principal purpose, it helps you when you are searching a product in a sale order for example, you can write two words separated and you can find the product inmediately. For example 'Coca Cola Light' you only have to write 'Coc Lig' and it's going to find it. Basically it was to help in sale orders, anyways it can be improved a lot even in the search box adding some 'and' or 'or'.

Andreas Maertens
Author

Do you have any idea where to find that functionality? I am looking for since hours.

Simplify it!

I don't think that some functionality like that exists, anyways I'll do it by the same method as I did this module. Only parsing some elements that is not really complicated you'll have a searchbox that can do what you want.

Avatar
avasen
Best Answer

HELLO i know this post is not from now but i wanted to know if you have found a sloution because i am faced to the same problem

thanks a lot

0
Avatar
Discard
Andreas Maertens
Author

Sorry, we still have no easy way to do that.

Avatar
Ahmet Altinisik
Best Answer

And I found https://www.openerp.com/apps/7.0/web_filter_and_condition/ - but haven't tested yet!

0
Avatar
Discard
Avatar
fisher
Best Answer
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
How to search for several words in products name from sales order? Solved
v7 search
Avatar
Avatar
Avatar
Avatar
8
Jul 24
18632
How to send a default model_id in a view? (old api)
default v7
Avatar
0
Apr 15
5722
Set default duration in res_config
default v7
Avatar
Avatar
Avatar
3
Mar 15
12894
How can I locate the certain SO/PO with the product code/desc?
v7 search
Avatar
Avatar
Avatar
2
Mar 15
7583
How to allow the use of the child_of operator for users ?
v7 search
Avatar
0
Mar 15
10374
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 Svenska ภาษาไทย 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