Content-Length: 308040 | pFad | http://github.com/odoo/odoo/pull/193708

E8 [FIX] core: disable typofix translations when upgrade by HydrionBurst · Pull Request #193708 · odoo/odoo · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] core: disable typofix translations when upgrade #193708

Open
wants to merge 1 commit into
base: saas-18.1
Choose a base branch
from

Conversation

HydrionBurst
Copy link
Contributor

@HydrionBurst HydrionBurst commented Jan 15, 2025

[FIX] core: disable typofix translations when upgrade

Before:
The typofix feature treats terms in the old and new values with similar text
content as the same term, migrating the translations of the old term to the new
term.

For example

The old value has the mapping:
'Draft': 'Brouillon'

The new value contains the term:
'<span invisible="name or name_placeholder or quick_edit_mode">Draft</span>'

Since the old term and the new has the same text content 'Draft', after write,
the new term will reuse the old translation of 'Draft'. However, the translation
'Brouillon' is always visible unlike its en_US term

Since the old term and the new term share the same text content, 'Draft', after
write, the new term reuses the old translation of 'Draft'. However, the
translation 'Brouillon' is always visible, unlike its en_US counterpart.

This behavior is acceptable in non-upgrade mode because the user writes the
en_US value and is responsible for verifying translations afterward. However, it
is problematic during upgrades because users cannot easily identify which
records have changed and need to be rechecked.

After:

  1. Revert 7cd56fc as it is no longer needed.
  2. Disable typofix translations during upgrades.
    Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@robodoo
Copy link
Contributor

robodoo commented Jan 15, 2025

Pull request status dashboard

@HydrionBurst
Copy link
Contributor Author

Note:
This PR should only affect the upgrade/install and be safe for stable versions
If it improves the upgrade with no/acceptble side-effects, we will backport it to 16.0

@C3POdoo C3POdoo requested review from a team, kmagusiak and ryv-odoo and removed request for a team January 15, 2025 09:47
@C3POdoo C3POdoo added the RD research & development, internal work label Jan 15, 2025
Copy link
Contributor

@aj-fuentes aj-fuentes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For extra context: during the upgrade we get issues if some translated terms are not updated properly. Common ones are missing attributes (invisible, class, ...) or wrong structure (xpath targeting a span element that was not added). These are source of many tickets in upgrade. A recent one is opw-4440528 but many similar issues happen that either show wrong structure, or completely fail the view.

IMO if we can get rid of this system during upgrades and we observe no extra impact for custom translations (in terms of post upgrade tickets) then this solution would be effective in getting rid of a whole category of issues.

@HydrionBurst HydrionBurst force-pushed the saas-18.1-core-no-upgrade-translation-typofix-cwg branch 2 times, most recently from a2f366b to 40a2fc6 Compare January 16, 2025 07:58
Copy link
Contributor

@kmagusiak kmagusiak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

odoo/orm/fields_textual.py Outdated Show resolved Hide resolved
Before:
The typofix feature treats terms in the old and new values with similar text
content as the same term, migrating the translations of the old term to the new
term.

For example

The old value has the mapping:
'Draft': 'Brouillon'

The new value contains the term:
'<span invisible="name or name_placeholder or quick_edit_mode">Draft</span>'

Since the old term and the new has the same text content 'Draft', after write,
the new term will reuse the old translation of 'Draft'. However, the translation
'Brouillon' is always visible unlike its en_US term

Since the old term and the new term share the same text content, 'Draft', after
`write`, the new term reuses the old translation of 'Draft'. However, the
translation 'Brouillon' is always visible, unlike its en_US counterpart.

This behavior is acceptable in non-upgrade mode because the user writes the
en_US value and is responsible for verifying translations afterward. However, it
is problematic during upgrades because users cannot easily identify which
records have changed and need to be rechecked.

After:
1. Revert 7cd56fc as it is no longer needed.
2. Disable typofix translations during upgrades.
@HydrionBurst HydrionBurst force-pushed the saas-18.1-core-no-upgrade-translation-typofix-cwg branch from 40a2fc6 to 162fead Compare January 16, 2025 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/odoo/odoo/pull/193708

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy