Allow nested inherited views

Search and use the recursive type of the views

issue5206
review17691002
This commit is contained in:
Cédric Krier
2015-12-31 14:15:51 +01:00
parent 1f04a58562
commit 71c0e0a3af
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -1,3 +1,4 @@
* Allow nested inherited view
* Add button on cron to run once
* Check all fields when writing a sequence of records, values (CVE-2015-0861)
* Add view_ids on tree view
+2 -2
View File
@@ -241,13 +241,13 @@ class ModelView(Model):
else:
domain = [
('model', '=', cls.__name__),
('type', '=', view_type),
['OR',
('inherit', '=', None),
('inherit.model', '!=', cls.__name__),
],
]
views = View.search(domain)
views = filter(lambda v: v.rng_type == view_type, views)
if views:
view = views[0]
if view:
@@ -258,7 +258,7 @@ class ModelView(Model):
# if a view was found
if view:
result['type'] = view.type
result['type'] = view.rng_type
result['view_id'] = view_id
result['arch'] = view.arch
result['field_childs'] = view.field_childs