[FIX] fields.py: in many2one convert_to_cache, value can be int but long as well
authorChristophe Simonis <chs@odoo.com>
Thu, 27 Nov 2014 16:05:48 +0000 (17:05 +0100)
committerDenis Ledoux <dle@odoo.com>
Thu, 27 Nov 2014 16:06:48 +0000 (17:06 +0100)
openerp/fields.py

index 580cfd0..67c7991 100644 (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: