bugfixes
authorFabien Pinckaers <fp@tinyerp.com>
Wed, 24 Dec 2008 10:48:11 +0000 (11:48 +0100)
committerFabien Pinckaers <fp@tinyerp.com>
Wed, 24 Dec 2008 10:48:11 +0000 (11:48 +0100)
bzr revid: fp@tinyerp.com-20081224104811-54gb87thafjay1sj

bin/osv/orm.py
bin/tools/misc.py

index 0a39472..25e63e2 100644 (file)
@@ -1353,12 +1353,11 @@ class orm_memory(orm_template):
         return result
 
 class orm(orm_template):
-
     _sql_constraints = []
-
     _log_access = True
     _table = None
     _protected = ['read','write','create','default_get','perm_read','unlink','fields_get','fields_view_get','search','name_get','distinct_field_get','name_search','copy','import_data','search_count']
+
     def _parent_store_compute(self, cr):
         logger = netsvc.Logger()
         logger.notifyChannel('init', netsvc.LOG_INFO, 'Computing parent left and right for table %s...' % (self._table, ))
index 6241365..ac5f869 100644 (file)
@@ -572,9 +572,9 @@ class cache(object):
             if time.time()-self.timeout > self.lasttime:
                 self.lasttime = time.time()
                 t = time.time()-self.timeout 
-                old_keys = [key for key in self.cache if self.cache[key][1] < t]
-                for key in old_keys:
-                    del self.cache[key]
+                for key in self.cache.keys():
+                    if self.cache[key][1]<t:
+                        del self.cache[key]
 
             if cr is None:
                 self.cache = {}