From 7b6f5176ade76fedbcfeb7941f63fc91dc7440d8 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Mon, 12 Sep 2011 19:17:01 +0200 Subject: [PATCH] [IMP] crm.lead: overridden name_get to hide the inherited res.partner.address behavior bzr revid: odo@openerp.com-20110912171701-x68ngyw3hot90or0 --- addons/crm/crm_lead.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index e13c80c5668..c409ce2aef2 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -42,6 +42,14 @@ class crm_lead(crm_case, osv.osv): _order = "priority,date_action,id desc" _inherit = ['mail.thread','res.partner.address'] + # overridden because res.partner.address has an inconvenient name_get, + # especially if base_contact is installed. + def name_get(self, cr, user, ids, context=None): + if isinstance(ids, (int, long)): + ids = [ids] + return [(r['id'], tools.ustr(r[self._rec_name])) + for r in self.read(cr, user, ids, [self._rec_name], context)] + def _compute_day(self, cr, uid, ids, fields, args, context=None): """ @param cr: the current row, from the database cursor,