Permalink
Browse files

fixup! [FIX] base: correct translation synchronisation

  • Loading branch information...
KangOl committed Jan 10, 2019
1 parent af2d8bf commit ff7427c9b01b7fd1e16a4c32b55f8084b5d4ddb2
Showing with 2 additions and 4 deletions.
  1. +2 −4 odoo/addons/base/models/ir_translation.py
@@ -488,6 +488,8 @@ def _sync_terms_translations(self, field, records):
for translation in translations:
if translation.src == translation.value:
discarded += translation
# consider it done to avoid being matched against another term
done.add((translation.src, translation.lang))
elif translation.src in terms:
done.add((translation.src, translation.lang))
else:
@@ -500,10 +502,6 @@ def _sync_terms_translations(self, field, records):
outdated += translation
elif (src, translation.lang) in done:
discarded += translation
elif any(d.src == src for d in discarded):
# If a previously discarded (because src==value) translation match the close
# term, we should also discard this translation to avoid constraint violation
discarded += translation
else:
translation.write({'src': src, 'state': translation.state})
done.add((src, translation.lang))

0 comments on commit ff7427c

Please sign in to comment.