diff options
| author | Martin Trigaux <mat@odoo.com> | 2019-10-17 09:17:52 +0200 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2019-11-19 11:36:57 +0100 |
| commit | 95ed21795d1618c0144f50d5265cee6c21c332d4 (patch) | |
| tree | e58c5184d32a2a69b3812d77c62d8b3a14339f82 /addons/web/static/src/js/views/basic/basic_model.js | |
| parent | 62d3675869048af9b6d11236659f31081470a749 (diff) | |
[IMP] tools: create TranslationModuleReader class
Instead of previous long methods, use a class to clarify what the
export actually does.
The TranslationModuleReader is written to copy the API of the
TranslationFileWriter.
This way, exporting translations is reduced to:
1. create a reader that will fetch all module translations (either
from db or from static files)
2. create a writer in a specific format (po or csv)
3. export the content from the reader to the writer
Simplify the writer by deducing modules from exported translations
instead of fetching it again in a oneliner (this way can benefit from
yield operations)
Remove the 'all_installed' possibility in modules as it was not
working (creating query with 2 WHERE clause).
The new methode _get_translatable_records works on a per model basis.
This will allow a big performance gain as the previous code was
making a .exists() for each record individually.
In the future, this method could be removed as the main goal is to
test the presence of the rare attribute _translate=False.
Diffstat (limited to 'addons/web/static/src/js/views/basic/basic_model.js')
0 files changed, 0 insertions, 0 deletions
