[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:06:48 +01:00
committed by Denis Ledoux
parent 5f47fc84e9
commit de27e19794
+1 -1
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: