summaryrefslogtreecommitdiff
path: root/odoo/fields.py
diff options
context:
space:
mode:
authorMoises Lopez <moylop260@vauxoo.com>2016-12-06 16:24:38 +0100
committerMartin Trigaux <mat@odoo.com>2016-12-07 10:47:04 +0100
commitf507fc95c7b6c8e347aca61307c90238d385a106 (patch)
tree7334f4f134b46106b844622ce5619866a95dfbb5 /odoo/fields.py
parentb33f919e3dc21c98b6836830cadc6b475454d07a (diff)
[IMP] fields: remove '_id(s)' from the label
For autogenerated labels. Use title instead of capitalize to get every word with a capital letter. Closes #12769
Diffstat (limited to 'odoo/fields.py')
-rw-r--r--odoo/fields.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/odoo/fields.py b/odoo/fields.py
index 8971c239ac9..e43c8ddabb6 100644
--- a/odoo/fields.py
+++ b/odoo/fields.py
@@ -470,7 +470,10 @@ class Field(object):
if not self.string and not self.related:
# related fields get their string from their parent field
- self.string = name.replace('_', ' ').capitalize()
+ self.string = (
+ name[:-4] if name.endswith('_ids') else
+ name[:-3] if name.endswith('_id') else name
+ ).replace('_', ' ').title()
# self.default must be a callable
if self.default is not None: