[REF] Base_contact : search() of Address corrected
authorJay (Open ERP) <jvo@tinyerp.com>
Mon, 17 May 2010 06:34:31 +0000 (12:04 +0530)
committerJay (Open ERP) <jvo@tinyerp.com>
Mon, 17 May 2010 06:34:31 +0000 (12:04 +0530)
bzr revid: jvo@tinyerp.com-20100517063431-glyy8cejapfusb51

addons/base_contact/base_contact.py

index 187d2d4..0a3e21b 100644 (file)
@@ -127,8 +127,9 @@ class res_partner_address(osv.osv):
             @param limit: The Number of Results to Return
             @param context: A standard dictionary for contextual values
         """
-
-        if context and context.has_key('address_partner_id' ) and context['address_partner_id']:
+        if context is None:
+            context = {}
+        if context.get('address_partner_id',False):
             args.append(('partner_id', '=', context['address_partner_id']))
         return super(res_partner_address, self).search(cr, user, args, offset, limit, order, context, count)