Searching many2one field

Asked by Erik Myllymaki

What is the proper way to search on a many2one field?

This method works with one2many field (product.seller_id):

product_ids ='product.product', [('seller_ids', '=', '1')])

but the same form does not work with a many2one field.

Question information

English Edit question
OERPLib Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
S├ębastien Alix (sebastien-alix) said :

Hi Erik,

Nothing is wrong about your code, nor with OERPLib :)
In fact, the 'seller_id' field of the 'product.product' model is a 'fields.function' without a search function defined, making it a no-searchable field for OpenERP (it is the default behaviour of a field function).

Try to override this field in a custom module and implement the 'fnct_search' parameter for this field:


Can you help with this problem?

Provide an answer of your own, or ask Erik Myllymaki for more information if necessary.

To post a message you must log in.