Open
Conversation
cbbc130 to
d84085d
Compare
cammarosano
commented
Jan 25, 2026
server/src/core/odoo.rs
Outdated
|
|
||
|
|
||
| /// Evaluation of available languages is lazy and cached. | ||
| /// It assumes that res.lang.csv is the only source of 'res.lang' records |
b30bfce to
d0a9706
Compare
d0a9706 to
60790ad
Compare
This commit adds validation for language codes in the form of "field_name@lang_code" in records definitions within XML files. A warning is issued if the specified language code does not match one of the known res.lang records. In order to keep track of res.lang records, a data hook system has been introduced (similar to python arch build and eval hooks). This allows registering hooks for data file events, such as record creation and file unload. With these hooks, SyncOdoo maintains an up-to-date set of available language codes. It also keeps track of XML file symbols whose validation step depend on these language codes, and trigger their rebuild when the set of language codes changes.
12ad6d5 to
6a23ecf
Compare
In case someone wants to add support for a language that doesn't have a corresponding res.lang record in the data files, they can now add it to the additional_languages config option. This allows the added language to be recognized as valid and prevents a warning for unknown language code in field@lang translations in XML files. Lists of language codes added in different config files are merged together.
This commits factors out the config update handling logic from `Odoo::check_handle_config_file_update` into a dedicated `Odoo::handle_config_update`. This has two benefits: - better separation of concerns (one handles the config **file** update, while the other handles the replacement of the current config with a new ConfigEntry) - it allows for easier testing of config updates without needing to go through the file update logic Based on this, this commit introduces a test for checking whether the OLS05058 diagnostic (unknown language code) is refreshed correctly when the additional_languages config is updated.
6a23ecf to
47817ba
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validate language codes in XML record definitions (field_name@lang_code form) against
Details