[fix] exception when querying a tree view for an osv which does not contain any column (common in the wizards)
lp bug: https://launchpad.net/bugs/877989 fixed bzr revid: nicolas.vanhoren@openerp.com-20111110135106-crieyt6cnscqocs5
This commit is contained in:
parent
a21a208e4c
commit
dbb82b089b
|
@ -1808,7 +1808,7 @@ class BaseModel(object):
|
|||
"""
|
||||
_rec_name = self._rec_name
|
||||
if _rec_name not in self._columns:
|
||||
_rec_name = self._columns.keys()[0]
|
||||
_rec_name = self._columns.keys()[0] if len(self._columns.keys()) > 0 else "id"
|
||||
|
||||
view = etree.Element('tree', string=self._description)
|
||||
etree.SubElement(view, 'field', name=_rec_name)
|
||||
|
|
Loading…
Reference in New Issue