[FIX]res_country : fix traceback when no value is written in 'code' field when creating a new country

bzr revid: csn@openerp.com-20130131121052-5nbctbtwozamf0zw
This commit is contained in:
csn-openerp 2013-01-31 13:10:52 +01:00
parent bd2aa9bc32
commit 51eec43574
1 changed files with 1 additions and 1 deletions

View File

@ -71,7 +71,7 @@ addresses belonging to this country.\n\nYou can use the python-style string pate
name_search = location_name_search
def create(self, cursor, user, vals, context=None):
if 'code' in vals:
if vals.get('code'):
vals['code'] = vals['code'].upper()
return super(Country, self).create(cursor, user, vals,
context=context)