Skip to content

Fork Sync Branch 18.0 - #157

Merged
btl-bot merged 4 commits into
BTLzdravtech:18.0from
OCA:18.0
Nov 12, 2026
Merged

btl-bot merged 4 commits into
BTLzdravtech:18.0from
OCA:18.0

Conversation

@btl-bot

@btl-bot btl-bot commented Nov 12, 2026

Copy link
Copy Markdown

No description provided.

guewen and others added 4 commits October 30, 2026 10:00
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/
Signed-off-by simahawk

@sireko sireko left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto approved

@btl-bot
btl-bot merged commit 5bb5a72 into BTLzdravtech:18.0 Nov 12, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants