[FIX] web_editor, website: remove unused param

`_view_get_inherited_children()` `options` parameter is not more useful.
Introduced with ae8232136d and not used since edce2fd6d0.

Also, the opportunity is taken to rename `options` in `_views_get` into
`get_children. Indeed `options` does not mean much.

closes odoo/odoo#35157

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
This commit is contained in:
Romain Derie
2019-07-24 16:06:27 +00:00
parent 463bfd5b05
commit bac4b43a23
2 changed files with 9 additions and 9 deletions
+7 -7
View File
@@ -203,7 +203,7 @@ class IrUiView(models.Model):
self.write({'arch': self._pretty_arch(new_arch)})
@api.model
def _view_get_inherited_children(self, view, options):
def _view_get_inherited_children(self, view):
return view.inherit_children_ids
@api.model
@@ -220,7 +220,7 @@ class IrUiView(models.Model):
# Used by translation mechanism, SEO and optional templates
@api.model
def _views_get(self, view_id, options=True, bundles=False, root=True):
def _views_get(self, view_id, get_children=True, bundles=False, root=True):
""" For a given view ``view_id``, should return:
* the view itself
* all views inheriting from it, enabled or not
@@ -249,17 +249,17 @@ class IrUiView(models.Model):
except ValueError:
continue
if called_view and called_view not in views_to_return:
views_to_return += self._views_get(called_view, options=options, bundles=bundles)
views_to_return += self._views_get(called_view, get_children=get_children, bundles=bundles)
extensions = self._view_get_inherited_children(view, options)
if not options:
extensions = self._view_get_inherited_children(view)
if not get_children:
# only active children
extensions = extensions.filtered(lambda view: view.active)
# Keep options in a deterministic order regardless of their applicability
# Keep children in a deterministic order regardless of their applicability
for extension in extensions.sorted(key=lambda v: v.id):
# only return optional grandchildren if this child is enabled
for ext_view in self._views_get(extension, options=extension.active, root=False):
for ext_view in self._views_get(extension, get_children=extension.active, root=False):
if ext_view not in views_to_return:
views_to_return += ext_view
return views_to_return
+2 -2
View File
@@ -211,8 +211,8 @@ class View(models.Model):
return most_specific_views
@api.model
def _view_get_inherited_children(self, view, options):
extensions = super(View, self)._view_get_inherited_children(view, options)
def _view_get_inherited_children(self, view):
extensions = super(View, self)._view_get_inherited_children(view)
return extensions.filter_duplicate()
@api.model