Skip to content

Commit

Permalink
[FIX] base: avoid ignoring right translations
Browse files Browse the repository at this point in the history
DBs with a long versions history could have right translations with
wrong to_translate states. We should try to fix them in advance to avoid
missing them.

TT51774
  • Loading branch information
chienandalu committed Nov 18, 2024
1 parent f185ced commit dffd75a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions openupgrade_scripts/scripts/base/16.0.1.3/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@ def login_or_registration_required_at_checkout(cr):


def update_translatable_fields(cr):
# Fix terms with wrong to_translate state. DBs with long version history could have
# terms that didn't have the right state and those would be ignored
openupgrade.logged_query(
cr,
"""
UPDATE ir_translation set state = 'translated'
WHERE type = 'model'
AND state = 'to_translate'
AND value is NOT NULL
AND value IS DISTINCT FROM src
""",
)
# exclude fields from translation update
exclusions = {
# ir.actions.* inherits the name and help columns from ir.actions.actions
Expand Down

0 comments on commit dffd75a

Please sign in to comment.