From f7dbab8db7f6b8f316744ecccd5c5b51b71b8b95 Mon Sep 17 00:00:00 2001 From: Ila Rana Date: Tue, 21 Jun 2011 11:07:00 +0530 Subject: [PATCH 1/2] [FIX] Base : Added active field in address view in order to let the user deactivate the address lp bug: https://launchpad.net/bugs/795018 fixed bzr revid: ira@tinyerp.com-20110621053700-p9syely27nm0sqbh --- bin/addons/base/res/partner/partner.py | 2 +- bin/addons/base/res/partner/partner_view.xml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/addons/base/res/partner/partner.py b/bin/addons/base/res/partner/partner.py index a2de7f9d154..ea3c7f240ad 100644 --- a/bin/addons/base/res/partner/partner.py +++ b/bin/addons/base/res/partner/partner.py @@ -222,7 +222,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 %s',(tuple(ids),)) + cr.execute('select type,id from res_partner_address where partner_id IN %s and active',(tuple(ids),)) res = cr.fetchall() adr = dict(res) # get the id of the (first) default address if there is one, diff --git a/bin/addons/base/res/partner/partner_view.xml b/bin/addons/base/res/partner/partner_view.xml index 8ca7e43c6d1..38f963360c3 100644 --- a/bin/addons/base/res/partner/partner_view.xml +++ b/bin/addons/base/res/partner/partner_view.xml @@ -99,6 +99,7 @@ + From 60c1394e69a86a7969b1d51f8ea71c9066fb28af Mon Sep 17 00:00:00 2001 From: Ila Rana Date: Wed, 22 Jun 2011 10:53:10 +0530 Subject: [PATCH 2/2] [FIX] Base : Added active field in address view in order to let the user deactivate the address lp bug: https://launchpad.net/bugs/795018 fixed bzr revid: ira@tinyerp.com-20110622052310-wt39drs7lz38x0js --- bin/addons/base/res/partner/partner.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/addons/base/res/partner/partner.py b/bin/addons/base/res/partner/partner.py index ea3c7f240ad..af222af372e 100644 --- a/bin/addons/base/res/partner/partner.py +++ b/bin/addons/base/res/partner/partner.py @@ -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