← Back to team overview

openerp-dev-web team mailing list archive

[Bug 710859] [NEW] [6.0] many2one field on search screen searches by name - doesn't work for object with a custom name_get function

 

Devishree Brahmbhatt (OpenERP) (dbr-openerp) has assigned this bug to you for OpenERP Web Client:

First off, loving the enhancements in version 6.0! The new menu
structure possibilities and custom search screens are a massive
improvement! :)

However, I've found a bit of an issue with the handling of many2one
fields on a custom Search screen. The web client and hence the server
uses the record 'Name' field, instead of the selected ID to search
many2one fields.

This is a problem for any objects that have a custom name_get function.

For example, I have a search screen with a partner_contact_id field on
it, which is a many2one field pointing at the res.partner.contact
object. When I select my name in the box ("Russell Briggs") the query
that is generated on the server on the res.partner.contact object is:

['|', ('name', 'ilike', 'Russell Briggs'), ('first_name', 'ilike',
'Russell Briggs')]

This doesn't return any records, because the actual record in the
database has first_name = "Russell" and name = "Briggs"

It would make more sense if the server searched by ID when a record is
selected in a many2one search field, is there a reason why this is not
the case?

** Affects: openobject-client-web
     Importance: Low
     Assignee: OpenERP SA's Web Client R&D (openerp-dev-web)
         Status: Confirmed

-- 
[6.0] many2one field on search screen searches by name - doesn't work for object with a custom name_get function
https://bugs.launchpad.net/bugs/710859
You received this bug notification because you are a member of OpenERP SA's Web Client R&D, which is a bug assignee.