parent
cee6ed33ac
commit
c65fe46569
|
@ -743,6 +743,8 @@ class res_partner(osv.Model, format_address):
|
|||
adr_pref.add('default')
|
||||
result = {}
|
||||
visited = set()
|
||||
if isinstance(ids, (int, long)):
|
||||
ids = [ids]
|
||||
for partner in self.browse(cr, uid, filter(None, ids), context=context):
|
||||
current_partner = partner
|
||||
while current_partner:
|
||||
|
@ -765,7 +767,7 @@ class res_partner(osv.Model, format_address):
|
|||
current_partner = current_partner.parent_id
|
||||
|
||||
# default to type 'default' or the partner itself
|
||||
default = result.get('default', partner.id)
|
||||
default = result.get('default', ids and ids[0] or False)
|
||||
for adr_type in adr_pref:
|
||||
result[adr_type] = result.get(adr_type) or default
|
||||
return result
|
||||
|
|
Loading…
Reference in New Issue