odoo
odoo copied to clipboard
[FIX] core: avoid modifying shared fields
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
@robodoo override=ci/security
The use of type in the code should not harm:
- it only happens when deleting some
ir.model.fieldsrecord while uninstalling a module; - regular users cannot change the name or model of
ir.model.fieldsrecords, except for custom fields, and a field's new name cannot correspond to another field on the model (because of unicity constraint); - the
fieldobject 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
fieldexcept forprefetch=False.
@robodoo r+
@robodoo r-
