[res_country] : Create country without code or remove country code raise error

bzr revid: dhs@tinyerp.com-20130206061832-r9s9m9oco6uwdg4j
This commit is contained in:
Dhruti Shastri
2013-02-06 11:48:32 +05:30
parent d5fb59d7a8
commit 9778533d7e
+2 -2
View File
@@ -71,13 +71,13 @@ 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 vals.get('code'):
if vals.get('code',False):
vals['code'] = vals['code'].upper()
return super(Country, self).create(cursor, user, vals,
context=context)
def write(self, cursor, user, ids, vals, context=None):
if 'code' in vals:
if vals.get('code',False):
vals['code'] = vals['code'].upper()
return super(Country, self).write(cursor, user, ids, vals,
context=context)