Open pedrobaeza opened 1 year ago
Well I think it should be easy enough to do both.
For v16+ are we not just dumping to a dict, do each value, converting back and writing?
And for the old EAV style, we can do out of band anyway. I think there is enough information because what we know for sure is 1. It will either be a .
or _
and 2. There are no duplicates. Therefore a SELECT src, value FROM ir_translation WHERE name like '<table_name>,<field>' ...
instead of =
and the _ in table name become placeholders.
This might help: https://github.com/OCA/openupgradelib/pull/358/files
There's a problem with the method
convert_field_to_html
, as it doesn't handle correctly translatable fields.This method makes simple SQL queries over SQL contents, but on translatable fields < v16, this should touch also
ir.translation
rows corresponding to each record. But for implementing any sort of this, there's not enough information passed through arguments, as we are passing the table and the field name, but not the model name (which can't be reversed out of the table name, as not all_
may be converted to.
).We also need to modify it to handle JSON translations for >=v16.
Should we change the API for the method? Leave it as is and handle only v16+?