bugfix
authorFabien Pinckaers <fp@tinyerp.com>
Wed, 4 Feb 2009 23:27:10 +0000 (00:27 +0100)
committerFabien Pinckaers <fp@tinyerp.com>
Wed, 4 Feb 2009 23:27:10 +0000 (00:27 +0100)
bzr revid: fp@tinyerp.com-20090204232710-kkf3r1gk9ebhli4q

bin/osv/orm.py
bin/tools/convert.py
bin/tools/translate.py

index b93a715..ec61d9a 100644 (file)
@@ -2130,7 +2130,10 @@ class orm(orm_template):
 
         for order, object, ids, fields in result_store:
             if object<>self._name:
-                self.pool.get(object)._store_set_values(cr, uid, ids, fields, context)
+                cr.execute('select id from '+self._table+' where id in ('+','.join(map(str, ids))+')')
+                ids = map(lambda x: x[0], cr.fetchall())
+                if ids:
+                    self.pool.get(object)._store_set_values(cr, uid, ids, fields, context)
         return True
 
     #
index dedc7ab..71bbb80 100644 (file)
@@ -677,7 +677,12 @@ form: module.record_id""" % (xml_id,)
         if self.isnoupdate(data_node) and self.mode != 'init':
             # check if the xml record has an id string
             if rec_id:
-                id = self.pool.get('ir.model.data')._update_dummy(cr, self.uid, rec_model, self.module, rec_id)
+                if '.' in rec_id:
+                    module,rec_id2 = rec_id.split('.')
+                else:
+                    module = self.module
+                    rec_id2 = rec_id
+                id = self.pool.get('ir.model.data')._update_dummy(cr, self.uid, rec_model, module, rec_id2)
                 # check if the resource already existed at the last update
                 if id:
                     # if it existed, we don't update the data, but we need to
index 0f84bdc..5b309cf 100644 (file)
@@ -566,7 +566,10 @@ def trans_load_data(db_name, fileobj, fileformat, lang, strict=False, lang_name=
             finally:
                 # locale.resetlocale is bugged with some locales. 
                 # we need to normalize the result of locale.getdefaultlocale()
-                locale.setlocale(locale.LC_ALL, locale.normalize(locale._build_localename(locale.getdefaultlocale())))
+                try:
+                    locale.setlocale(locale.LC_ALL, locale.normalize(locale._build_localename(locale.getdefaultlocale())))
+                except:
+                    locale.setlocale(locale.LC_ALL, lc)
 
 
         # now, the serious things: we read the language file