← Back to team overview

openerp-dev-web team mailing list archive

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

 

** Changed in: openobject-client-web
       Status: Triaged => In Progress

-- 
You received this bug notification because you are a member of OpenERP
SA's Web Client R&D, which is a bug assignee.
https://bugs.launchpad.net/bugs/710859

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

Status in OpenERP Web Client:
  In Progress

Bug description:
  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?