X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=bin%2Faddons%2Fbase%2Fres%2Fpartner%2Fpartner.py;h=82acd80d6ce7c7dd44c9bd7ff16d7f87aa8c5429;hb=8c64e3c18b4614043aea37c2bbefb633b467809b;hp=2e5c23c7b6c8242ea56567dd96b483049e76d7d3;hpb=f8aba817650998929d80f291a4ce15dc19ac4680;p=odoo%2Fodoo.git diff --git a/bin/addons/base/res/partner/partner.py b/bin/addons/base/res/partner/partner.py index 2e5c23c..82acd80 100644 --- a/bin/addons/base/res/partner/partner.py +++ b/bin/addons/base/res/partner/partner.py @@ -1,22 +1,21 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution -# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved -# $Id$ +# Copyright (C) 2004-2009 Tiny SPRL (). # # This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# GNU Affero General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . # ############################################################################## @@ -71,7 +70,7 @@ class res_partner_category(osv.osv): def _check_recursion(self, cr, uid, ids): level = 100 while len(ids): - cr.execute('select distinct parent_id from res_partner_category where id in ('+','.join(map(str,ids))+')') + cr.execute('select distinct parent_id from res_partner_category where id in ('+','.join(map(str, ids))+')') ids = filter(None, map(lambda x:x[0], cr.fetchall())) if not level: return False @@ -235,7 +234,7 @@ class res_partner(osv.osv): return True def address_get(self, cr, uid, ids, adr_pref=['default']): - cr.execute('select type,id from res_partner_address where partner_id in ('+','.join(map(str,ids))+')') + cr.execute('select type,id from res_partner_address where partner_id in ('+','.join(map(str,map(int, ids)))+')') res = cr.fetchall() adr = dict(res) # get the id of the (first) default address if there is one, @@ -307,7 +306,7 @@ class res_partner_address(osv.osv): return [] res = [] for r in self.read(cr, user, ids, ['name','zip','city','partner_id', 'street']): - if context.get('contact_display', 'contact')=='partner': + if context.get('contact_display', 'contact')=='partner' and r['partner_id']: res.append((r['id'], r['partner_id'][1])) else: addr = r['name'] or ''