[FIX] fields.py: in many2one convert_to_cache, value can be int but long as well
This commit is contained in:
parent
5f47fc84e9
commit
de27e19794
|
@ -1451,7 +1451,7 @@ class Many2one(_Relational):
|
||||||
records._cache[self] = value
|
records._cache[self] = value
|
||||||
|
|
||||||
def convert_to_cache(self, value, record, validate=True):
|
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)
|
return record.env[self.comodel_name].browse(value)
|
||||||
if isinstance(value, BaseModel):
|
if isinstance(value, BaseModel):
|
||||||
if value._name == self.comodel_name and len(value) <= 1:
|
if value._name == self.comodel_name and len(value) <= 1:
|
||||||
|
|
Loading…
Reference in New Issue