[IMP] ir_translation: discard trivial translations (src=value) upon terms synchronization

This avoids keeping old values in automatically generated translations when
fixing the XML value to translate.
This commit is contained in:
Raphael Collet
2015-10-07 16:51:36 +02:00
parent 3e3ba3e2b7
commit 3571c0e4a4
+3 -1
View File
@@ -457,7 +457,9 @@ class ir_translation(osv.osv):
# remap existing translations on terms when possible
for trans in record_trans:
if trans.src not in terms:
if trans.src == trans.value:
discarded += trans
elif trans.src not in terms:
matches = get_close_matches(trans.src, terms, 1, 0.9)
if matches:
trans.write({'src': matches[0], 'state': trans.state})