Repository navigation
Fork Sync Branch 18.0 - #157
Merged
Merged
Conversation
The onchange override adds temporary fields to the wizard's `_fields`.
These temporary dynamic fields have no `model_name`.
On a cold worker, the registry may have not computed `_field_triggers`
(a lazy property) and the call to `super().onchange()` triggers the
computation of the property. In that case, it fails with `KeyError:
None` because of the missing `model_name`.
After such error, the worker fails systematically with:
File "/odoo/src/odoo/fields.py", line 800, in resolve_depends
Model0 = registry[self.model_name]
~~~~~~~~^^^^^^^^^^^^^^^^^
File "/odoo/src/odoo/modules/registry.py", line 234, in __getitem__
return self.models[model_name]
~~~~~~~~~~~^^^^^^^^^^^^
KeyError: None
This correction forces the computation of `_field_triggers` **before**
the call to onchange to prevent the temporary dynamic fields to break
the registry.
Also, the cleaning of the dynamic fields has to be done in a finally,
otherwise any error in an onchange would leave the dynamic fields in
`_fields`, leading to the same error later.
Currently translated at 100.0% (24 of 24 strings) Translation: server-ux-18.0/server-ux-18.0-document_quick_access_folder_auto_classification Translate-URL: https://translation.odoo-community.org/projects/server-ux-18-0/server-ux-18-0-document_quick_access_folder_auto_classification/it/
sireko
approved these changes
Nov 12, 2026
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.
No description provided.