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
1=== modified file 'base_contact/base_contact.py'
2--- base_contact/base_contact.py 2012-02-15 13:22:13 +0000
3+++ base_contact/base_contact.py 2012-02-24 12:29:24 +0000
4@@ -29,9 +29,9 @@
5 _description = "Contact"
6
7 def _name_get_full(self, cr, uid, ids, prop, unknow_none, context=None):
8- result = {}
9+ result = dict.fromkeys(ids, "NONAME")
10 for rec in self.browse(cr, uid, ids, context=context):
11- result[rec.id] = rec.last_name+' '+(rec.first_name or '')
12+ result[rec.id] = ('%s %s' % ((rec.first_name or ''), rec.last_name)).strip()
13 return result
14
15 _columns = {
16@@ -73,7 +73,7 @@
17 if context is None:
18 context = {}
19 if name:
20- ids = self.search(cr, uid, ['|',('name', operator, name),('first_name', operator, name)] + args, limit=limit, context=context)
21+ ids = self.search(cr, uid, ['|',('last_name', operator, name),('first_name', operator, name)] + args, limit=limit, context=context)
22 else:
23 ids = self.search(cr, uid, args, limit=limit, context=context)
24 return self.name_get(cr, uid, ids, context=context)
25
26=== modified file 'base_contact/base_contact_view.xml'
27--- base_contact/base_contact_view.xml 2012-01-31 13:36:57 +0000
28+++ base_contact/base_contact_view.xml 2012-02-24 12:29:24 +0000
29@@ -10,8 +10,8 @@
30 <field name="type">tree</field>
31 <field name="arch" type="xml">
32 <tree string="Partner Contact">
33- <field name="name"/>
34 <field name="first_name"/>
35+ <field name="last_name"/>
36 <field name="mobile"/>
37 <field name="email"/>
38 <field name="lang_id"/>