diff -r 448c5a919032 trytond/model/browse.py --- a/trytond/model/browse.py Thu Sep 03 01:13:50 2009 +0200 +++ b/trytond/model/browse.py Thu Sep 03 17:13:05 2009 +0200 @@ -56,7 +56,9 @@ self._id = record_id self._model = model self._model_name = self._model._name - self._context = context or {} + if context is None: + context = {} + self._context = context cache_ctx = self._context.copy() for i in ('_timestamp', '_delete', '_create_records', @@ -71,7 +73,9 @@ if not record_id in self._data: self._data[record_id] = {'id': record_id} self._cache = cache - self._local_cache = local_cache or {} + if local_cache is None: + local_cache ={} + self._local_cache = local_cache self._local_cache.setdefault(model._name, {}) self._local_cache.setdefault('_language_cache', {}) self._local_data = self._local_cache[model._name] @@ -133,7 +137,11 @@ col = self._model._inherit_fields[j.datetime_field][2] ffields.append((j.datetime_field, col)) - ids = [x for x in self._data.keys() \ + if len(self._data) <= self._cursor.IN_MAX: + iterids = self._data.iterkeys() + else: + iterids = self._local_data.iterkeys() + ids = [x for x in iterids \ if not self._data[x].has_key(name) \ and not self._local_data.setdefault(x, {}).has_key(name)] # read the data diff -r 448c5a919032 trytond/tools/convert.py --- a/trytond/tools/convert.py Thu Sep 03 01:13:50 2009 +0200 +++ b/trytond/tools/convert.py Thu Sep 03 17:13:05 2009 +0200 @@ -344,6 +344,13 @@ object_ids = ids models = model_obj.browse(self.cursor, self.user, object_ids) for model in models: + if model.id in self.browserecord[module][model_name]: + for cache in self.cursor.cache.values(): + for cache in (cache, cache.get('_language_cache', + {}).values()): + if model_name in cache \ + and model.id in cache[model_name]: + cache[model_name][model.id] = {} self.browserecord[module][model_name][model.id] = model def fetch_new_module(self, module): @@ -352,7 +359,7 @@ self.cursor, self.user, [ ('module', '=', module), ('inherit', '=', False), - ]) + ], order=[('db_id', 'ASC')]) record_ids = {} for rec in self.modeldata_obj.browse( @@ -817,6 +824,7 @@ 'values': values, 'date_update': time.strftime('%Y-%m-%d %H:%M:%S'), }) + self.fs2db.reset_browsercord(module, object_ref._name, db_id) else: # this record is new, create it in the db: