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.

0

How can we search by a specific field ? {V8}

By
nizar
on 4/22/16, 10:05 AM 256 views

What happened ?

i have added a field in my product form , which display the number of the product . Everything works fine. Now what i want to do , is to be able to make a search by the new field ( number ) .

I went to settings - Fields and i saw that i have the option Not Searchable and i change it to searchable . But it still can't search , anyone know why?




And what if my data isn't a computed one? i have added an integer field in the product form. 

nizar
on 4/22/16, 5:38 PM
0
ibra
On 5/12/16, 1:24 PM

Hello Nizar, 

i don't know if you solved the problem or you still looking for a solution..

this is done by creating a search view that looks like this : 

<record id="your Id " model="ir.ui.view">
    <field name="name"> search</field>
    <field name="model">Your model</field>
    <field name="arch" type="xml">
        <search string="searchbyname">
            <field name="number"/>        
            <group string="Filter">     // if you want to set filters...
             ...
       </search>
    </field>
</record>

Now all you have to do is to  fill the seach box with  a number and choose search in number.

let me know if it works 

Best regards. 


0
nizar
On 5/12/16, 11:17 AM

Thanks for the answer , My field is not computed. I have just added a field called number to my products. What i want to do , is to make a search on my products by number. Any help?

0
Mohamed Essakali
On 4/22/16, 3:51 PM

If your field is a computed one (Function), it must be stored to allow searching on. In this case you must add store=True. 

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

1 follower(s)

Stats

Asked: 4/22/16, 10:05 AM
Seen: 256 times
Last updated: 5/12/16, 1:24 PM