summaryrefslogtreecommitdiff
path: root/odoo/models.py
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2020-08-17 07:39:25 +0000
committerXavier Morel <xmo@odoo.com>2020-08-17 09:30:53 +0000
commitbfa00919cd893694c55d5fa9680c3dbbd1f66d3e (patch)
tree417885cec009b6e47517688b08d9a7ef33b81e70 /odoo/models.py
parentbfcc7dee8f40afb5f7dec4e2cf5a669c0682e2ed (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/models.py')
-rw-r--r--odoo/models.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/odoo/models.py b/odoo/models.py
index ba9cb15b6c4..a3b221433f7 100644
--- a/odoo/models.py
+++ b/odoo/models.py
@@ -2888,6 +2888,9 @@ class BaseModel(MetaModel('DummyModel', (object,), {'_register': False})):
})
def format_groups(field):
+ if field.groups == '.':
+ return _("always forbidden")
+
anyof = self.env['res.groups']
noneof = self.env['res.groups']
for g in field.groups.split(','):