projects
/
odoo
/
odoo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4d6fb49
)
[IMP] translate: small, non-breaking code improvements
author
Raphael Collet
<rco@openerp.com>
Thu, 27 Nov 2014 10:07:09 +0000
(11:07 +0100)
committer
Raphael Collet
<rco@openerp.com>
Tue, 2 Dec 2014 08:40:59 +0000
(09:40 +0100)
openerp/tools/translate.py
patch
|
blob
|
history
diff --git
a/openerp/tools/translate.py
b/openerp/tools/translate.py
index
e02319f
..
32fd5bc
100644
(file)
--- a/
openerp/tools/translate.py
+++ b/
openerp/tools/translate.py
@@
-667,8
+667,7
@@
def trans_generate(lang, modules, cr):
return
tnx = (module, source, name, id, type, tuple(comments or ()))
return
tnx = (module, source, name, id, type, tuple(comments or ()))
- if tnx not in _to_translate:
- _to_translate.add(tnx)
+ _to_translate.add(tnx)
def encode(s):
if isinstance(s, unicode):
def encode(s):
if isinstance(s, unicode):
@@
-1002,8
+1001,8
@@
def trans_load_data(cr, fileobj, fileformat, lang, lang_name=None, verbose=True,
if not res_id:
return
if not res_id:
return
- if unicode(res_id).isdigit():
- # res_id is either an integer, or a string composed of digits only
+ if isinstance(res_id, (int, long)) or \
+ (isinstance(res_id, basestring) and res_id.isdigit()):
dic['res_id'] = int(res_id)
dic['module'] = module_name
else:
dic['res_id'] = int(res_id)
dic['module'] = module_name
else: