Skip to content

Commit

Permalink
[FIX] website: fix typo on domain
Browse files Browse the repository at this point in the history
Because there is a trailing comma, the code crashes and the domain becomes a
tuple.

Closes odoo#62041

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
  • Loading branch information
rdeodoo authored and fmdl committed Apr 29, 2021
1 parent 463495a commit 4884bd0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addons/website/models/website_snippet_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def render(self, template_key, limit, search_domain=[]):
content = View._render_template(template_key, dict(records=records)).decode('utf-8')
return [ET.tostring(el) for el in ET.fromstring('<root>%s</root>' % content).getchildren()]

def _prepare_values(self, limit=None, search_domain=[]):
def _prepare_values(self, limit=None, search_domain=None):
"""Gets the data and returns it the right format for render."""
self.ensure_one()
limit = limit and min(limit, self.limit) or self.limit
Expand All @@ -69,7 +69,7 @@ def _prepare_values(self, limit=None, search_domain=[]):
if 'is_published' in self.env[filter_sudo.model_id]:
domain = expression.AND([domain, [('is_published', '=', True)]])
if search_domain:
domain = expression.AND([domain, search_domain]),
domain = expression.AND([domain, search_domain])

records = self.env[filter_sudo.model_id].search(
domain,
Expand Down

0 comments on commit 4884bd0

Please sign in to comment.