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

record and search product description

By
Payam
on 8/5/16, 3:11 AM 230 views

I wonder to know how I can have both Partnumber and product description in Odoo product and search them

as and example assume I have a disk which its partnumber is:

HDS-2TV-MZ7KM240HAGR005

and its description is:

Samsung SSD SM863, 240GB, SATA 6Gb/s, VNAND, 2.5", 7.0mm, 19nm (3.6 DWPD) w/SED

and I want my users to be able to search by putting "SSD" 

1
Pinakin Nayi (pna)
On 8/5/16, 8:56 AM

You can improve search view and filter domain like below,

 <field name="name" string="Product" filter_domain="['|',('name','ilike',self),('description','ilike',self)"/>

Thank you Pinakin for your hint

as I'm pretty new to Odoo, I tool you comment and searched around that to come up with the final solution

for those who might get to this question, I'm writing down my steps:

- Actually, my description was in notes and in the "Description for Quotations"

- first I needed to find the name of this field in the model. clicked on help icon on the top right corner then "About" and then clicked on "Activate the developer mode" and its colored turned into blue

- went to Purchase (or where ever the item is) and clicked on the product and open a product and entered in the edit mode and then change to the "Note" tab and put the mouse cursor on the text box. The field name appeared: description_sale. Also, I found the object name (which this field was related to) there: "product.template"

- went to settings (top bar), technical, user interface, views

-serached for "product.template" (when type "product.template" in the search box, the second item searches based on objects)

- in the result page, there were a few views from the type of "Search". I realized that "product.template.search" was the main search view which other product search views were inherited from. (click on it and check "inherited views" and you would see)

- I decided to modify the main search view so all other views would have this option. selected architecture tab and clicked edit

this was the main line for the product search there:

<field name="name" string="Product" filter_domain="['|',('default_code','ilike',self),('name','ilike',self)]"/>

I added the below line

<field name="name" string="Description" filter_domain="['|','|',('default_code','ilike',self),('name','ilike',self),('description_sale','ilike',self)]"/>

(attention to the format of '|' operator. still I have not found a solid document on this, but this link was helpful http://stackoverflow.com/questions/32463585/odoo-searching-multiple-custom-fields-with-one-string)

-save

-refresh page

- put someting in the note->"Description for Quotations"

- go to products page and put something in the search box and select the second row (Description) and it will search both name and description

Payam
on 8/5/16, 10:25 PM

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: 8/5/16, 3:11 AM
Seen: 230 times
Last updated: 8/5/16, 10:24 PM