[FIX] Base : Added active field in address view in order to let the user deactivate...
authorIla Rana <ira@tinyerp.com>
Wed, 22 Jun 2011 05:23:10 +0000 (10:53 +0530)
committerIla Rana <ira@tinyerp.com>
Wed, 22 Jun 2011 05:23:10 +0000 (10:53 +0530)
lp bug: https://launchpad.net/bugs/795018 fixed

bzr revid: ira@tinyerp.com-20110622052310-wt39drs7lz38x0js

bin/addons/base/res/partner/partner.py

index ea3c7f2..af222af 100644 (file)
@@ -222,8 +222,10 @@ 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 %s and active',(tuple(ids),))
-        res = cr.fetchall()
+        address_obj = self.pool.get('res.partner.address')
+        address_ids = address_obj.search(cr, uid, [('partner_id', '=', ids)])
+        address_rec = address_obj.read(cr, uid, address_ids, ['type'])
+        res = list(tuple(addr.values()) for addr in address_rec)
         adr = dict(res)
         # get the id of the (first) default address if there is one,
         # otherwise get the id of the first address in the list