From e8db098bac00574090cbc60b68e4d0fe315a94ea Mon Sep 17 00:00:00 2001 From: Martin Trigaux <mat@odoo.com> Date: Mon, 29 Aug 2016 16:42:14 +0200 Subject: [PATCH] [FIX] models: display all fields of a model When a model has no form defined, a default view is generated displaying all fields of the model. The one2many and many2many fields were not displayed on the form, probably for aesthetic or historical (2008) reasons. --- openerp/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openerp/models.py b/openerp/models.py index 687902183e3f..a4a833422fdd 100644 --- a/openerp/models.py +++ b/openerp/models.py @@ -1233,14 +1233,14 @@ class BaseModel(object): @api.model def _get_default_form_view(self): """ Generates a default single-line form view using all fields - of the current model except the m2m and o2m ones. + of the current model. :returns: a form view as an lxml document :rtype: etree._Element """ group = E.group(col="4") for fname, field in self._fields.iteritems(): - if field.automatic or field.type in ('one2many', 'many2many'): + if field.automatic: continue group.append(E.field(name=fname)) if field.type == 'text': -- GitLab