[FIX] translation: corrected search on loading translation.
authorVo Minh Thu <vmt@openerp.com>
Mon, 17 Jan 2011 14:05:04 +0000 (15:05 +0100)
committerVo Minh Thu <vmt@openerp.com>
Mon, 17 Jan 2011 14:05:04 +0000 (15:05 +0100)
bzr revid: vmt@openerp.com-20110117140504-ha3nilfa7csxh3bs

bin/tools/translate.py

index 0f47b6f..55c8ccf 100644 (file)
@@ -919,7 +919,12 @@ def trans_load_data(cr, fileobj, fileformat, lang, lang_name=None, verbose=True,
                 ('src', '=', dic['src']),
             ]
             if dic['type'] == 'model':
-                args.append(('res_id', '=', dic['res_id']))
+                if dic['res_id'] is False:
+                    args.append(('res_id', '=', 0))
+                    args.append(('module', '=', dic['module']))
+                    args.append(('xml_id', '=', dic['xml_id']))
+                else:
+                    args.append(('res_id', '=', dic['res_id']))
             ids = trans_obj.search(cr, uid, args)
             if ids:
                 if context.get('overwrite') and dic['value']: