diff --git a/tree_view_record_id/__openerp__.py b/tree_view_record_id/__openerp__.py index dd04071eb..d8b1bfaff 100644 --- a/tree_view_record_id/__openerp__.py +++ b/tree_view_record_id/__openerp__.py @@ -25,9 +25,9 @@ 'category': 'Other modules', 'sequence': 10, 'author': 'Akretion', - 'summary': "Add id field to tree views", + 'summary': "Adds id field to tree views", 'description': """ -Add Id field to all non arborescent tree views. +Adds Id field to all non arborescent tree views. Id field is the primary key of the table (Odoo model). Arborescent views like 'Products by Category' or 'Chart of accounts' haven't this field included. """, diff --git a/tree_view_record_id/orm.py b/tree_view_record_id/orm.py index 6f6994126..2922d9e3c 100644 --- a/tree_view_record_id/orm.py +++ b/tree_view_record_id/orm.py @@ -38,13 +38,11 @@ def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, self, cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu) if view_type == 'tree': - compatible_tree = False + compatible_tree = res.get('field_parent', True) is False # Tree views with res['field_parent'] different from False # looks like 'Products by Category'. # We don't modify these views # to avoid to break them (js error) - if res.get('field_parent', True) is False: - compatible_tree = True if compatible_tree and DUMMY_MODEL in self.pool.models.keys(): doc = etree.XML(res['arch']) if doc.xpath("//tree") and len(doc.xpath("//field[@name='id']")) == 0: