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 to set a new search filter?

By
Alex
on 3/31/13, 9:35 PM 3,114 views

I have created a new partner type called x_creditor and I have created window action and the menu item without problem for showing it on accounting menu as customer and supplier ones. But I need some help with filters. When I click on customer or supplier the window shows only these kind of partners and I would like to get the same with my new x_creditor partner.

I thought watching customer and supplier window action could copy the filter but I couldn't. I was trying with this on context value:

{'search_default_x_creditor': 1,'default_customer': 0,'default_supplier': 0,'default_x_creditor': 1}

But shows me all the partners and no filter. What's wrong?

Thank you.

This will also work in V7. Check Out This Link

Parth Gajjar
on 4/1/13, 3:01 AM

Yes, it works if I put {"search_default_customer":1} or {"search_default_supplier":1} but not with my custom field x_creditor. My field is working as a boolean type like the others but if I write {"search_default_x_creditor":1} there's no filter and every partner are showed.

Alex
on 4/1/13, 5:47 AM
0

Fabien Pinckaers (fp)

--Fabien Pinckaers (fp)--
6598
| 6 8 8
fsdsdfsdf, Belgium
--Fabien Pinckaers (fp)--

Odoo Founder & CEO

Fabien Pinckaers (fp)
On 4/1/13, 9:36 AM

It does not work because your new field x_creditoris not defined in the search view of the object.

Another way to do this, is to create a filter using an advanced search. Then, you can save your filter Save Current Filter and check the box `Use by default'. But this will work only for the current user.

Exactly! I had to add this line: <filter string="Creditor" name="x_creditor" domain="[('x_creditor','=',1)]" help="Creditor Partners"/> on res.partner.select. Thank you Fabien.

Alex
on 4/1/13, 11:46 AM

hi is there any way to edit the labels listed in the advanced search option.

Ashmsh.M
on 11/27/13, 6:02 AM

Please, I need to search Bom components by its (default_code) from product file?

Walid Redwan
on 3/4/14, 9:15 AM

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: 3/31/13, 9:35 PM
Seen: 3114 times
Last updated: 3/16/15, 8:10 AM