[17.0][OU-FIX] account: Use migrate_translations_to_jsonb to migrate translations from the field - #5355
Conversation
|
Isn't this covered by the base module and the fix should be to not perform anything here? |
|
I don't quite understand what you mean by the base module.
Simply renaming it would not be enough, because the database column will not be in json (with the appropriate translations) and Odoo will auto-set the empty json column (without translations). IMO, using the |
pedrobaeza
left a comment
There was a problem hiding this comment.
OK, you have answered me indirectly. The key is that there's a renaming in between: description > invoice_label. That can be the reason why the method in the base module doesn't handle the transition to JSONB.
I wait for @hbrunn to confirm the change as well.
hbrunn
left a comment
There was a problem hiding this comment.
what does this change? migrate_translations_to_jsonb calls convert_column_translatable internally, and only adds running the translation queries afterwards. But as you rightly pointed out the field isn't translatable in v16, so I wouldn't expect this to make any difference?
Which problem are you solving here?
|
Oops, I think I forgot to clarify something important: the |
|
aaah yes, now that makes sense. No, just keep the code as it is, as the translation queries shouldn't do anything for the case where the field isn't translated. Just add a comment that you deliberately call |
060ca6c to
1cb34cc
Compare
hbrunn
left a comment
There was a problem hiding this comment.
please revert to your previous version, because the way it's now, it's wrong and only doesn't fail tests because the multilang addon is installed in the CI database.
As written above, I think it's perfectly safe to just call migrate_translations_to_jsonb unconditionally
1cb34cc to
b097c5d
Compare
|
Hey, thanks for contributing! Proceeding to merge this for you. |
|
This PR has the |
|
Congratulations, your PR was merged at 2a8b5d2. Thanks a lot for contributing to OCA. ❤️ |
Use migrate_translations_to_jsonb to migrate translations from the field
Related to 3d5ebac
Similar to
OpenUpgrade/openupgrade_scripts/scripts/base/16.0.1.3/end-migration.py
Line 39 in 4af8572
Please @pedrobaeza can you review it?
@Tecnativa TT57778