[IMP] Improved address_get method of partner for few corrections, replaced query...
authorIla(OpenERP), Vincent(Camptocamp) <>
Fri, 1 Jul 2011 07:29:24 +0000 (12:59 +0530)
committerpso (OpenERP) <pso@tinyerp.com>
Fri, 1 Jul 2011 07:29:24 +0000 (12:59 +0530)
bzr revid: pso@tinyerp.com-20110701072924-xfxgwh68t8ygre0a

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

index 5bf33cc..4ed7db4 100644 (file)
@@ -217,8 +217,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', (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
index 6ed8118..dea6977 100644 (file)
@@ -95,6 +95,7 @@
                     <newline/>
                     <field name="mobile" select="2"/>
                     <field name="email" select="2" widget="email"/>
+                    <field name="active" select="2"/>
                 </form>
             </field>
         </record>