[FIX] fields.py: in many2one convert_to_cache, value can be int but long as well

This commit is contained in:
Christophe Simonis 2014-11-27 17:05:48 +01:00 committed by Denis Ledoux
parent 5f47fc84e9
commit de27e19794
1 changed files with 1 additions and 1 deletions

View File

@ -1451,7 +1451,7 @@ class Many2one(_Relational):
records._cache[self] = value
def convert_to_cache(self, value, record, validate=True):
if isinstance(value, (NoneType, int)):
if isinstance(value, (NoneType, int, long)):
return record.env[self.comodel_name].browse(value)
if isinstance(value, BaseModel):
if value._name == self.comodel_name and len(value) <= 1: