Merge lp:~openerp-dev/openobject-server/6.0-opw-6198-ira into lp:openobject-server/6.0

Proposed by Ila Rana(Open ERP)
Status: Merged
Approved by: Jay Vora (Serpent Consulting Services)
Approved revision: 3447
Merged at revision: 3456
Proposed branch: lp:~openerp-dev/openobject-server/6.0-opw-6198-ira
Merge into: lp:openobject-server/6.0
Diff against target: 28 lines (+5/-2)
2 files modified
bin/addons/base/res/partner/partner.py (+4/-2)
bin/addons/base/res/partner/partner_view.xml (+1/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-server/6.0-opw-6198-ira
Reviewer Review Type Date Requested Status
Christophe Simonis (OpenERP) Needs Fixing
Jay Vora (Serpent Consulting Services) (community) Approve
Priyesh (OpenERP) (community) Approve
Ila Rana(Open ERP) (community) Needs Resubmitting
Review via email: mp+65295@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Thanks for the fix Ila.

Before proceeding for the merge, should not we count the appearance of record rules if exists for address model?

Priyesh, can you please do a little test and replace the query by read() ?

Thanks.

review: Needs Information
3447. By Ila Rana(Open ERP)

[FIX] Base : Added active field in address view in order to let the user deactivate the address

Revision history for this message
Ila Rana(Open ERP) (ira-openerp) wrote :

Hello sir,

I have made changes as per your suggestion and replaced the query by ORM Methods.

Thanks,
Ila

review: Needs Resubmitting
Revision history for this message
Priyesh (OpenERP) (pso-openerp) wrote :

Hello Ila,

Code works fine as per requirements.

Thanks for the fix,
Priyesh

review: Approve
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Ila and Priyesh,

Thanks for the fix, this is a very good catch.

It would be good at the usability point of view if you put 'active' field on the top of the form OR in the new tab, but not under 'communication' tab.

Thanks once again.

review: Approve
Revision history for this message
Christophe Simonis (OpenERP) (kangol) wrote :

I know it's already merged in stable but this fix is broken.

In this case, the query doesn't bother me. On line 13 of the patch
>>> res = list(tuple(addr.values()) for addr in address_rec)
is completely false because the result of .values() is not guarantee to give the values in the same order for each dict. In this case, either you keep the query, either you use explicit fields via browse()

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/base/res/partner/partner.py'
2--- bin/addons/base/res/partner/partner.py 2011-01-17 15:17:57 +0000
3+++ bin/addons/base/res/partner/partner.py 2011-06-22 05:31:04 +0000
4@@ -222,8 +222,10 @@
5 return True
6
7 def address_get(self, cr, uid, ids, adr_pref=['default']):
8- cr.execute('select type,id from res_partner_address where partner_id IN %s',(tuple(ids),))
9- res = cr.fetchall()
10+ address_obj = self.pool.get('res.partner.address')
11+ address_ids = address_obj.search(cr, uid, [('partner_id', '=', ids)])
12+ address_rec = address_obj.read(cr, uid, address_ids, ['type'])
13+ res = list(tuple(addr.values()) for addr in address_rec)
14 adr = dict(res)
15 # get the id of the (first) default address if there is one,
16 # otherwise get the id of the first address in the list
17
18=== modified file 'bin/addons/base/res/partner/partner_view.xml'
19--- bin/addons/base/res/partner/partner_view.xml 2011-04-26 11:14:58 +0000
20+++ bin/addons/base/res/partner/partner_view.xml 2011-06-22 05:31:04 +0000
21@@ -99,6 +99,7 @@
22 <field name="fax"/>
23 <field name="mobile"/>
24 <field name="email" widget="email"/>
25+ <field name="active"/>
26 </group>
27 </form>
28 </field>