Skip to content

[FIX] orm: patch shared fields on module uninstall#273654

Closed
HydrionBurst wants to merge 1 commit into
odoo:masterfrom
odoo-dev:master-orm-fix-field-reuse-cwg
Closed

[FIX] orm: patch shared fields on module uninstall#273654
HydrionBurst wants to merge 1 commit into
odoo:masterfrom
odoo-dev:master-orm-fix-field-reuse-cwg

Conversation

@HydrionBurst

Copy link
Copy Markdown
Contributor

Overridden and inherited fields are shared across registries. Their _args__ is cleared to save memory once they are no longer used as _base_field__ of other fields (#267486).

During module uninstall we still need to disable prefetch on those fields. Building a new field with the shared instance as _base_field__ fails without _args__. Duplicate the field with copy.copy and set prefetch=False on the copy instead.

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

Overridden and inherited fields are shared across registries. Their
`_args__` is cleared to save memory once they are no longer used as
`_base_field__` of other fields (odoo#267486).

During module uninstall we still need to disable prefetch on those
fields. Building a new field with the shared instance as `_base_field__`
fails without `_args__`. Duplicate the field with `copy.copy` and set
`prefetch=False` on the copy instead.
@robodoo

robodoo commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Pull request status dashboard

@C3POdoo C3POdoo requested review from a team, kmagusiak and rco-odoo and removed request for a team July 2, 2026 11:20

@kmagusiak kmagusiak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@robodoo delegate+

@rco-odoo rco-odoo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

robodoo r+

@robodoo

robodoo commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

@HydrionBurst @rco-odoo 'ci/l10n' failed on this reviewed PR.

robodoo pushed a commit that referenced this pull request Jul 2, 2026
Overridden and inherited fields are shared across registries. Their
`_args__` is cleared to save memory once they are no longer used as
`_base_field__` of other fields (#267486).

During module uninstall we still need to disable prefetch on those
fields. Building a new field with the shared instance as `_base_field__`
fails without `_args__`. Duplicate the field with `copy.copy` and set
`prefetch=False` on the copy instead.

closes #273654

Signed-off-by: Raphael Collet <rco@odoo.com>
@robodoo robodoo added the 19.5 label Jul 2, 2026
@robodoo robodoo closed this Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants