Skip to content

[17.0][OU-FIX] account: Avoid the error when executing the migrate_translations_to_jsonb method - #5369

Merged
pedrobaeza merged 1 commit into
OCA:17.0from
Tecnativa:17.0-ou-fix-account-TT57778-v2
Sep 11, 2025
Merged

[17.0][OU-FIX] account: Avoid the error when executing the migrate_translations_to_jsonb method#5369
pedrobaeza merged 1 commit into
OCA:17.0from
Tecnativa:17.0-ou-fix-account-TT57778-v2

Conversation

@victoralmau

Copy link
Copy Markdown
Member

Avoid the error when executing the migrate_translations_to_jsonb method

Related to #5355

Fixes #5368

Please @pedrobaeza and @hbrunn can you review it?

@Tecnativa

@pedrobaeza pedrobaeza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Isn't Odoo in between pre and post doing anything with the column or giving an error?

@javierjcf

Copy link
Copy Markdown
Contributor

👍 It is working for me and fixing #5368

@Vicenteagf

Copy link
Copy Markdown

lgtm

@pedrobaeza pedrobaeza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

OK then

@pedrobaeza
pedrobaeza merged commit fd8e091 into OCA:17.0 Sep 11, 2025
4 checks passed
@pedrobaeza
pedrobaeza deleted the 17.0-ou-fix-account-TT57778-v2 branch September 11, 2025 09:50
@hbrunn

hbrunn commented Sep 12, 2025

Copy link
Copy Markdown
Member

wait a second here, are we sure this actually does something?

The ir_translation->jsonb transition was 15->16, so if in v16 the field was translatable, it was a json field all along.

@victoralmau is it possible you're migrating a database that has been migrated from v15 already, and what you're "fixing" here is actually a followup issue from the v16 migration?

Because I don't see how migrate_translations_to_jsonb ever does anything in a new v16 database

@pedrobaeza

Copy link
Copy Markdown
Member

Remember that this happens only with l10n_multilang installed.

@hbrunn

hbrunn commented Sep 12, 2025

Copy link
Copy Markdown
Member

yes, but still l10n_multilang installed in v16 makes the fields in question json fields, so I don't understand how migrate_translations_to_jsonb can do anything for the general case.

The only way I can imagine is that you had translations in v15, migrated to v16 and for whatever reason then the translations didn't end up in the json columns.

@pedrobaeza

Copy link
Copy Markdown
Member

I can't say right now. @victoralmau can you answer?

victoralmau added a commit to Tecnativa/OpenUpgrade that referenced this pull request Sep 15, 2025
…tion() method in post-migration.

Related to OCA#5369 (comment)

This change is not necessary because when migrating from 15 to 16, the description column in account_tax
will already be json (https://github.com/OCA/OpenUpgrade/blob/4af8572c7f3e313773db558ba382b5ffd19a157c/openupgrade_scripts/scripts/base/16.0.1.3/end-migration.py#L39),
therefore, in v17, you only need to rename the column (this is already done in pre-migration).

TT57778
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[17.0]account: key_error: 'account_tax' on method migrate_translations_to_jsonb

5 participants