[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.
This commit is contained in:
Martin Trigaux
2016-09-02 15:40:51 +02:00
parent d6ec094aac
commit e8db098bac
+2 -2
View File
@@ -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':