Merge lp:~openerp-dev/openobject-addons/trunk-base_contact-last_name-jth into lp:openobject-addons/6.1

Proposed by Julien Thewys
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-base_contact-last_name-jth
Merge into: lp:openobject-addons/6.1
Diff against target: 38 lines (+4/-4)
2 files modified
base_contact/base_contact.py (+3/-3)
base_contact/base_contact_view.xml (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-base_contact-last_name-jth
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+93858@code.launchpad.net

Description of the change

Fixes minor usability and consistency concerns about the new "last_name" field in base_contact:
- the old "name" was used instead of "last_name"
- first_name should come first, last_name should come last (except in a few cultures).

To post a comment you must log in.
6567. By Julien Thewys

[FIX] base_contact: stripping contact full name is more consistent

Unmerged revisions

6567. By Julien Thewys

[FIX] base_contact: stripping contact full name is more consistent

6566. By Julien Thewys

[FIX] base_contact: use new last_name field correctly

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'base_contact/base_contact.py'
--- base_contact/base_contact.py 2012-02-15 13:22:13 +0000
+++ base_contact/base_contact.py 2012-02-24 12:29:24 +0000
@@ -29,9 +29,9 @@
29 _description = "Contact"29 _description = "Contact"
3030
31 def _name_get_full(self, cr, uid, ids, prop, unknow_none, context=None):31 def _name_get_full(self, cr, uid, ids, prop, unknow_none, context=None):
32 result = {}32 result = dict.fromkeys(ids, "NONAME")
33 for rec in self.browse(cr, uid, ids, context=context):33 for rec in self.browse(cr, uid, ids, context=context):
34 result[rec.id] = rec.last_name+' '+(rec.first_name or '')34 result[rec.id] = ('%s %s' % ((rec.first_name or ''), rec.last_name)).strip()
35 return result35 return result
3636
37 _columns = {37 _columns = {
@@ -73,7 +73,7 @@
73 if context is None:73 if context is None:
74 context = {}74 context = {}
75 if name:75 if name:
76 ids = self.search(cr, uid, ['|',('name', operator, name),('first_name', operator, name)] + args, limit=limit, context=context)76 ids = self.search(cr, uid, ['|',('last_name', operator, name),('first_name', operator, name)] + args, limit=limit, context=context)
77 else:77 else:
78 ids = self.search(cr, uid, args, limit=limit, context=context)78 ids = self.search(cr, uid, args, limit=limit, context=context)
79 return self.name_get(cr, uid, ids, context=context)79 return self.name_get(cr, uid, ids, context=context)
8080
=== modified file 'base_contact/base_contact_view.xml'
--- base_contact/base_contact_view.xml 2012-01-31 13:36:57 +0000
+++ base_contact/base_contact_view.xml 2012-02-24 12:29:24 +0000
@@ -10,8 +10,8 @@
10 <field name="type">tree</field>10 <field name="type">tree</field>
11 <field name="arch" type="xml">11 <field name="arch" type="xml">
12 <tree string="Partner Contact">12 <tree string="Partner Contact">
13 <field name="name"/>
14 <field name="first_name"/>13 <field name="first_name"/>
14 <field name="last_name"/>
15 <field name="mobile"/>15 <field name="mobile"/>
16 <field name="email"/>16 <field name="email"/>
17 <field name="lang_id"/>17 <field name="lang_id"/>