diff options
| author | Xavier Morel <xmo@odoo.com> | 2020-08-17 07:39:25 +0000 |
|---|---|---|
| committer | Xavier Morel <xmo@odoo.com> | 2020-08-17 09:30:53 +0000 |
| commit | bfa00919cd893694c55d5fa9680c3dbbd1f66d3e (patch) | |
| tree | 417885cec009b6e47517688b08d9a7ef33b81e70 /odoo/fields.py | |
| parent | bfcc7dee8f40afb5f7dec4e2cf5a669c0682e2ed (diff) | |
[IMP] core: clarify making fields inaccessible
* add a constant to `fields` for that purpose
* add a test to ensure that it works as expected
* fix the formatter so it handles the pattern correctly
Diffstat (limited to 'odoo/fields.py')
| -rw-r--r-- | odoo/fields.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/odoo/fields.py b/odoo/fields.py index 4695eb2c43d..f1c2942cc29 100644 --- a/odoo/fields.py +++ b/odoo/fields.py @@ -29,6 +29,9 @@ from odoo.exceptions import CacheMiss DATE_LENGTH = len(date.today().strftime(DATE_FORMAT)) DATETIME_LENGTH = len(datetime.now().strftime(DATETIME_FORMAT)) +# hacky-ish way to prevent access to a field through the ORM (except for sudo mode) +NO_ACCESS='.' + IR_MODELS = ( 'ir.model', 'ir.model.data', 'ir.model.fields', 'ir.model.fields.selection', 'ir.model.relation', 'ir.model.constraint', 'ir.module.module', |
