[MERGE]: Merge with latest trunk-server

bzr revid: rpa@tinyerp.com-20120725053015-tqsacqleyglf1eqa
This commit is contained in:
Rucha (Open ERP) 2012-07-25 11:00:15 +05:30
commit f8ad350b49
2 changed files with 6 additions and 6 deletions

View File

@ -49,7 +49,7 @@ import simplejson
_logger = logging.getLogger(__name__)
def _symbol_set(symb):
if symb == None or symb == False:
if symb is None or symb == False:
return None
elif isinstance(symb, unicode):
return symb.encode('utf-8')
@ -181,8 +181,8 @@ class reference(_column):
class char(_column):
_type = 'char'
def __init__(self, string, size, **args):
_column.__init__(self, string=string, size=size, **args)
def __init__(self, string="unknown", size=None, **args):
_column.__init__(self, string=string, size=size or None, **args)
self._symbol_set = (self._symbol_c, self._symbol_set_char)
# takes a string (encoded in utf8) and returns a string (encoded in utf8)
@ -191,7 +191,7 @@ class char(_column):
# * we need to remove the "symb==False" from the next line BUT
# for now too many things rely on this broken behavior
# * the symb==None test should be common to all data types
if symb == None or symb == False:
if symb is None or symb == False:
return None
# we need to convert the string to a unicode object to be able

View File

@ -758,7 +758,7 @@ class BaseModel(object):
'model_id': model_id,
'model': self._name,
'name': k,
'field_description': f.string.replace("'", " "),
'field_description': f.string,
'ttype': f._type,
'relation': f._obj or '',
'view_load': (f.view_load and 1) or 0,
@ -767,7 +767,7 @@ class BaseModel(object):
'required': (f.required and 1) or 0,
'selectable': (f.selectable and 1) or 0,
'translate': (f.translate and 1) or 0,
'relation_field': (f._type=='one2many' and isinstance(f, fields.one2many)) and f._fields_id or '',
'relation_field': f._fields_id if isinstance(f, fields.one2many) else '',
'serialization_field_id': None,
}
if getattr(f, 'serialization_field', None):