From cea5ee91ca0f33fddd28d14da9631e0bd6819219 Mon Sep 17 00:00:00 2001 From: Andro Gvivradze Date: Tue, 27 Sep 2022 09:06:10 +0000 Subject: [PATCH] [FIX] website_slides: apply correct domain when viewing ratings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit when you open course ratings view, it may show also some project ratings, if project id is same as course id. This commit solves the mentioned problem. Task-2997847 closes odoo/odoo#104057 X-original-commit: 73be65459550470f9839fb4f7c4bb2db65cb37ec Signed-off-by: Warnon Aurélien (awa) --- addons/website_slides/models/slide_channel.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/website_slides/models/slide_channel.py b/addons/website_slides/models/slide_channel.py index 2c9d9ba4cfe..26151b6f7b7 100644 --- a/addons/website_slides/models/slide_channel.py +++ b/addons/website_slides/models/slide_channel.py @@ -6,6 +6,7 @@ import uuid from collections import defaultdict from dateutil.relativedelta import relativedelta +import ast from odoo import api, fields, models, tools, _ from odoo.addons.http_routing.models.ir_http import slug, unslug @@ -791,7 +792,7 @@ class Channel(models.Model): def action_view_ratings(self): action = self.env["ir.actions.actions"]._for_xml_id("website_slides.rating_rating_action_slide_channel") action['name'] = _('Rating of %s') % (self.name) - action['domain'] = [('res_id', 'in', self.ids)] + action['domain'] = expression.AND([ast.literal_eval(action.get('domain', '[]')), [('res_id', 'in', self.ids)]]) return action def action_request_access(self):