[5.0] Regression in base_contact: revno 2568 breaks res.partner.job search (2010-02-05)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Released
|
Undecided
|
Anup(SerpentCS) |
Bug Description
The revno 2568 (<email address hidden>, see http://
(Note: This bug is present on the 5.0.7 release)
On revno 2551, the search method of the res.partner.job object was extended on base_contact to allow searching by contact name/first_name and introduced one bug (if order is 'sequence_contact' or 'sequence_partner' it breaks). Later the revno 2568 removed one line from that method breaking it a bit more.
The search method looks like this:
*****************
def search(self, cr, user, args, offset=0, limit=None, order=None, context=None, count=False):
job_ids = []
for arg in args:
if arg[0] == 'address_id':
elif arg[0] == 'contact_id':
for contact in contacts:
res = super(res_
if job_ids:
res = list(set(res + job_ids))
*****************
Without the "elif arg[0] == 'name':" line, the search on the contacts will be invalid, as it will be searching for an id (a contact id) on the name/first name fields!
But also, if the specified order field is on res_partner_job, but not on res_partner_contact (like 'sequence_
Related branches
Changed in openobject-addons: | |
assignee: | nobody → Anup (Open ERP) (ach-openerp) |
Changed in openobject-addons: | |
status: | New → Confirmed |
Changed in openobject-addons: | |
status: | Confirmed → In Progress |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I think that the code is wrong because the 'name' field of res.partner.job is a res.partner :/
We can override the search and use a key in the context or replace the name_search.
To check
- -- www.openerp. com www.openerp. com/planet/ enigmail. mozdev. org
Stephane Wirtel - "As OpenERP is OpenSource, please feel free to contribute."
Quality/Release Manager
Technical Project Manager
Tiny SPRL
40, Chaussee de Namur
B-1367 Grand-Rosiere
* Tel: +32.81.81.37.00
* Fax: +32.81.73.35.01
* Web: http://
* Planet: http://
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://
iEYEARECAAYFAku NSzsACgkQnqh8s2 7uQNW4hACgqo7kl kfwNTPWDksgFp8+ 2sgI yWcByPIVZbU7Nbi NV
8BMAn3tHVZyeLCF
=BCtP
-----END PGP SIGNATURE-----