Yogesh(Open ERP) has proposed merging 
lp:~openerp-dev/openobject-server/trunk-bug-785712-ysa into 
lp:openobject-server.

Requested reviews:
  Naresh(OpenERP) (nch-openerp)
Related bugs:
  Bug #787512 in Glipper: "feature request: cycle through history with a 
shortcut"
  https://bugs.launchpad.net/glipper/+bug/787512

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-bug-785712-ysa/+merge/64152
-- 
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-bug-785712-ysa/+merge/64152
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-server/trunk-bug-785712-ysa.
=== modified file 'openerp/addons/base/module/wizard/base_import_language.py'
--- openerp/addons/base/module/wizard/base_import_language.py	2011-01-06 13:06:54 +0000
+++ openerp/addons/base/module/wizard/base_import_language.py	2011-06-10 11:05:23 +0000
@@ -37,7 +37,7 @@
         'data': fields.binary('File', required=True),
     }
 
-    def import_lang(self, cr, uid, ids, context):
+    def import_lang(self, cr, uid, ids, context=None):
         """
             Import Language
             @param cr: the current row, from the database cursor.
@@ -45,7 +45,9 @@
             @param ids: the ID or list of IDs
             @param context: A standard dictionary
         """
-
+        if context is None:
+            context = {}
+        lang_obj = self.pool.get('res.lang')
         import_data = self.browse(cr, uid, ids)[0]
         fileobj = TemporaryFile('w+')
         fileobj.write(base64.decodestring(import_data.data))
@@ -56,7 +58,11 @@
         fileformat = first_line.endswith("type,name,res_id,src,value") and 'csv' or 'po'
         fileobj.seek(0)
 
-        tools.trans_load_data(cr, fileobj, fileformat, import_data.code, lang_name=import_data.name)
+        lang_ids = lang_obj.search(cr, uid, [('code', '=', import_data.code)], context=context)
+        if lang_ids:
+            context.update({'overwrite': True})
+
+        tools.trans_load_data(cr, fileobj, fileformat, import_data.code, lang_name=import_data.name, context=context)
         tools.trans_update_res_ids(cr)
         fileobj.close()
         return {}

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to