odoo icon indicating copy to clipboard operation
odoo copied to clipboard

[FIX] core: avoid modifying shared fields

Open HydrionBurst opened this issue 1 year ago • 1 comments

when a field object is not _toplevel, it may be shared with multiple registries and should be readonly in any case

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

HydrionBurst avatar Oct 08 '24 19:10 HydrionBurst

Pull request status dashboard

robodoo avatar Oct 08 '24 19:10 robodoo

@robodoo override=ci/security

The use of type in the code should not harm:

  • it only happens when deleting some ir.model.fields record while uninstalling a module;
  • regular users cannot change the name or model of ir.model.fields records, except for custom fields, and a field's new name cannot correspond to another field on the model (because of unicity constraint);
  • the field object corresponding to the deleted record must be in the registry;
  • the field's class is used to instanciate a new field that is equivalent to field except for prefetch=False.

rco-odoo avatar Oct 14 '24 14:10 rco-odoo

@robodoo r+

rco-odoo avatar Oct 14 '24 14:10 rco-odoo

@robodoo r-

rco-odoo avatar Oct 14 '24 14:10 rco-odoo