Merge pull request #559 from odoo-dev/master-default-form-view-fme

[FIX] new style for default form views
This commit is contained in:
Fabien Meghazi 2014-06-16 13:40:54 +02:00
commit b4ea1965e5
1 changed files with 3 additions and 2 deletions

View File

@ -1718,13 +1718,14 @@ class BaseModel(object):
:rtype: etree._Element
"""
view = etree.Element('form', string=self._description)
group = etree.SubElement(view, 'group', col="4")
# TODO it seems fields_get can be replaced by _all_columns (no need for translation)
for field, descriptor in self.fields_get(cr, user, context=context).iteritems():
if descriptor['type'] in ('one2many', 'many2many'):
continue
etree.SubElement(view, 'field', name=field)
etree.SubElement(group, 'field', name=field)
if descriptor['type'] == 'text':
etree.SubElement(view, 'newline')
etree.SubElement(group, 'newline')
return view
def _get_default_search_view(self, cr, user, context=None):