From 5649fc88e8f3022f4143400a124f2e3c1e5c0df8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Mon, 14 Oct 2019 11:05:55 +0000 Subject: [PATCH] [REF] {website_}mail: move and replace published field of mail.message to is_internal PURPOSE Clean posting process and improve mail.message definition and comprehension. SPECIFICATIONS Website mail defines a website_published field allowing to publish / unpublish comments on the frontend of some modules. This field has several drawbacks : * it is used only for front-end people (portal, public) and has no real effect in chatter / classic discussions; * it is used only in some advanced front-end module and is not available in portal by default; * its naming is not really correct as it is not linked to fields coming from the website_published mixin and its behavior is not really the same; * its use is a bit duplicated with internal flag coming from subtype allowing to hide messages related to an internal subtype; * there are overrides of standard mail.message methods just to handle this flag; In this commit we change that field by an is_internal flag directly on mail.message model itself. It tells if share people (customers, share users) are allowed to read the message. This field can be given through posting API or set manually using widgets. It is also used in access rights custom methods and managed like the internal flag of subtypes. Mailgateway was already using an internal flag for internal note replies. It is renamed to is_internal and propagated as it is now a standard field. It also eases code understanding. Portal is updated to allow managing the flag directly. It means customer portal now natively allows to moderate customer comments without any need of website modules. Rating is updated accordingly. An is_internal field is added, replacing the related on website published. LINKS Task ID 2071556 PR #38692 --- addons/im_livechat/controllers/main.py | 1 + addons/mail/models/mail_message.py | 12 +++- addons/mail/models/mail_thread.py | 11 ++-- addons/portal/controllers/mail.py | 9 ++- addons/portal/models/mail_message.py | 6 +- addons/portal/static/src/js/portal_chatter.js | 33 ++++++++++- addons/portal/static/src/scss/portal.scss | 12 ++++ .../portal/static/src/xml/portal_chatter.xml | 13 +++++ addons/rating/models/rating.py | 1 + addons/rating/models/rating_mixin.py | 3 +- addons/website_mail/__manifest__.py | 4 +- addons/website_mail/models/__init__.py | 1 - addons/website_mail/models/mail_message.py | 58 ------------------- .../security/website_mail_security.xml | 13 ----- .../static/src/js/portal_chatter.js | 13 ----- .../static/src/xml/portal_chatter.xml | 23 -------- addons/website_mail/views/assets.xml | 1 - addons/website_rating/models/rating.py | 2 - addons/website_sale/models/product.py | 2 +- addons/website_slides/controllers/mail.py | 4 +- addons/website_slides/controllers/main.py | 2 +- .../website_slides/data/slide_user_demo.xml | 5 -- addons/website_slides/models/slide_channel.py | 2 +- 23 files changed, 92 insertions(+), 139 deletions(-) delete mode 100644 addons/website_mail/models/mail_message.py delete mode 100644 addons/website_mail/security/website_mail_security.xml delete mode 100644 addons/website_mail/static/src/js/portal_chatter.js delete mode 100644 addons/website_mail/static/src/xml/portal_chatter.xml diff --git a/addons/im_livechat/controllers/main.py b/addons/im_livechat/controllers/main.py index 84f8a83ac47..41c8c0042dd 100644 --- a/addons/im_livechat/controllers/main.py +++ b/addons/im_livechat/controllers/main.py @@ -112,6 +112,7 @@ class LivechatController(http.Controller): 'rating': rate, 'consumed': True, 'feedback': reason, + 'is_internal': False, } if not channel.rating_ids: res_model_id = request.env['ir.model'].sudo().search([('model', '=', channel._name)], limit=1).id diff --git a/addons/mail/models/mail_message.py b/addons/mail/models/mail_message.py index 539557f93e9..2b906074915 100644 --- a/addons/mail/models/mail_message.py +++ b/addons/mail/models/mail_message.py @@ -73,6 +73,7 @@ class Message(models.Model): mail_activity_type_id = fields.Many2one( 'mail.activity.type', 'Mail Activity Type', index=True, ondelete='set null') + is_internal = fields.Boolean('Employee Only', help='Hide to public / portal users, independently from subtype configuration.') # origin email_from = fields.Char('From', help="Email address of the sender. This field is set when no matching partner is found and replaces the author_id field in the chatter.") author_id = fields.Many2one( @@ -234,9 +235,9 @@ class Message(models.Model): return super(Message, self)._search( args, offset=offset, limit=limit, order=order, count=count, access_rights_uid=access_rights_uid) - # Non-employee see only messages with a subtype (aka, no internal logs) + # Non-employee see only messages with a subtype and not internal if not self.env['res.users'].has_group('base.group_user'): - args = ['&', '&', ('subtype_id', '!=', False), ('subtype_id.internal', '=', False)] + list(args) + args = expression.AND([self._get_search_domain_share(), args]) # Perform a super with count as False, to have the ids, not a counter ids = super(Message, self)._search( args, offset=offset, limit=limit, order=order, @@ -359,7 +360,9 @@ class Message(models.Model): FROM "%s" AS message LEFT JOIN "mail_message_subtype" as subtype ON message.subtype_id = subtype.id - WHERE message.message_type = %%s AND (message.subtype_id IS NULL OR subtype.internal IS TRUE) AND message.id = ANY (%%s)''' % (self._table), ('comment', self.ids,)) + WHERE message.message_type = %%s AND + (message.is_internal IS TRUE OR message.subtype_id IS NULL OR subtype.internal IS TRUE) AND + message.id = ANY (%%s)''' % (self._table), ('comment', self.ids,)) if self._cr.fetchall(): raise AccessError( _('The requested operation cannot be completed due to security restrictions. Please contact your system administrator.\n\n(Document type: %s, Operation: %s)') % (self._description, operation) @@ -1279,3 +1282,6 @@ class Message(models.Model): 'message_needaction', 'message_needaction_counter', ], ids=[res_id]) + + def _get_search_domain_share(self): + return ['&', '&', ('is_internal', '=', False), ('subtype_id', '!=', False), ('subtype_id.internal', '=', False)] diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py index a4abcaae227..91e9c7e16a1 100644 --- a/addons/mail/models/mail_thread.py +++ b/addons/mail/models/mail_thread.py @@ -1056,7 +1056,7 @@ class MailThread(models.AbstractModel): parent_message = self.env['mail.message'].sudo().browse(message_dict['parent_id']) partner_ids = [] if not subtype_id: - if message_dict.pop('internal', False): + if message_dict.get('is_internal'): subtype_id = self.env['ir.model.data'].xmlid_to_res_id('mail.mt_note') if parent_message and parent_message.author_id: partner_ids = [parent_message.author_id.id] @@ -1367,7 +1367,7 @@ class MailThread(models.AbstractModel): 'references': references, 'in_reply_to': in-reply-to, 'parent_id': parent mail.message based on in_reply_to or references, - 'internal': answer to an internal message (note), + 'is_internal': answer to an internal message (note), 'date': date, 'attachments': [('file1', 'bytes'), ('file2', 'bytes')} @@ -1441,14 +1441,14 @@ class MailThread(models.AbstractModel): parent_ids = self.env['mail.message'].search([('message_id', '=', msg_dict['in_reply_to'])], limit=1) if parent_ids: msg_dict['parent_id'] = parent_ids.id - msg_dict['internal'] = parent_ids.subtype_id and parent_ids.subtype_id.internal or False + msg_dict['is_internal'] = parent_ids.subtype_id and parent_ids.subtype_id.internal or False if msg_dict['references'] and 'parent_id' not in msg_dict: references_msg_id_list = tools.mail_header_msgid_re.findall(msg_dict['references']) parent_ids = self.env['mail.message'].search([('message_id', 'in', [x.strip() for x in references_msg_id_list])], limit=1) if parent_ids: msg_dict['parent_id'] = parent_ids.id - msg_dict['internal'] = parent_ids.subtype_id and parent_ids.subtype_id.internal or False + msg_dict['is_internal'] = parent_ids.subtype_id and parent_ids.subtype_id.internal or False msg_dict.update(self._message_parse_extract_payload(message, save_original=save_original)) msg_dict.update(self._message_parse_extract_bounce(message, msg_dict)) @@ -1996,6 +1996,7 @@ class MailThread(models.AbstractModel): 'email_from': email_from, 'partner_ids': partner_ids, 'subtype_id': self.env['ir.model.data'].xmlid_to_res_id('mail.mt_note'), + 'is_internal': True, 'record_name': False, 'reply_to': MailThread._notify_get_reply_to(default=email_from, records=None)[False], 'message_id': tools.generate_tracking_message_id('message-notify'), @@ -2024,6 +2025,7 @@ class MailThread(models.AbstractModel): 'model': kwargs.get('model', self._name), 'res_id': self.ids[0] if self.ids else False, 'subtype_id': self.env['ir.model.data'].xmlid_to_res_id('mail.mt_note'), + 'is_internal': True, 'record_name': False, 'reply_to': self.env['mail.thread']._notify_get_reply_to(default=email_from, records=None)[False], 'message_id': tools.generate_tracking_message_id('message-notify'), # why? this is all but a notify @@ -2046,6 +2048,7 @@ class MailThread(models.AbstractModel): 'message_type': message_type, 'model': self._name, 'subtype_id': self.env['ir.model.data'].xmlid_to_res_id('mail.mt_note'), + 'is_internal': True, 'record_name': False, 'reply_to': self.env['mail.thread']._notify_get_reply_to(default=email_from, records=None)[False], 'message_id': tools.generate_tracking_message_id('message-notify'), # why? this is all but a notify diff --git a/addons/portal/controllers/mail.py b/addons/portal/controllers/mail.py index eddf8cb32ce..1cbff66cde5 100644 --- a/addons/portal/controllers/mail.py +++ b/addons/portal/controllers/mail.py @@ -158,6 +158,7 @@ class PortalChatter(http.Controller): 'options': { 'message_count': message_data['message_count'], 'is_user_public': is_user_public, + 'is_user_employee': request.env.user.has_group('base.group_user'), 'is_user_publisher': request.env.user.has_group('website.group_website_publisher'), 'display_composer': display_composer, 'partner_id': request.env.user.partner_id.id @@ -183,13 +184,19 @@ class PortalChatter(http.Controller): raise Forbidden() # Non-employee see only messages with not internal subtype (aka, no internal logs) if not request.env['res.users'].has_group('base.group_user'): - domain = expression.AND([Message._non_employee_message_domain(), domain]) + domain = expression.AND([Message._get_search_domain_share(), domain]) Message = request.env['mail.message'].sudo() return { 'messages': Message.search(domain, limit=limit, offset=offset).portal_message_format(), 'message_count': Message.search_count(domain) } + @http.route(['/mail/update_is_internal'], type='json', auth="user", website=True) + def portal_message_update_is_internal(self, message_id, is_internal): + message = request.env['mail.message'].browse(int(message_id)) + message.write({'is_internal': is_internal}) + return message.is_internal + class MailController(MailController): diff --git a/addons/portal/models/mail_message.py b/addons/portal/models/mail_message.py index 1d98ce7cf76..cfda6d5eaa0 100644 --- a/addons/portal/models/mail_message.py +++ b/addons/portal/models/mail_message.py @@ -10,7 +10,7 @@ class MailMessage(models.Model): def portal_message_format(self): return self._portal_message_format([ 'id', 'body', 'date', 'author_id', 'email_from', # base message fields - 'message_type', 'subtype_id', 'subject', # message specific + 'message_type', 'subtype_id', 'is_internal', 'subject', # message specific 'model', 'res_id', 'record_name', # document related ]) @@ -24,7 +24,3 @@ class MailMessage(models.Model): if not attachment.get('access_token'): attachment['access_token'] = IrAttachmentSudo.browse(attachment['id']).generate_access_token()[0] return message_values - - @api.model - def _non_employee_message_domain(self): - return ['&', ('subtype_id', '!=', False), ('subtype_id.internal', '=', False)] diff --git a/addons/portal/static/src/js/portal_chatter.js b/addons/portal/static/src/js/portal_chatter.js index 0b23ec2c386..8e5c0a3144f 100644 --- a/addons/portal/static/src/js/portal_chatter.js +++ b/addons/portal/static/src/js/portal_chatter.js @@ -20,7 +20,8 @@ var PortalChatter = publicWidget.Widget.extend({ template: 'portal.Chatter', xmlDependencies: ['/portal/static/src/xml/portal_chatter.xml'], events: { - "click .o_portal_chatter_pager_btn": '_onClickPager', + 'click .o_portal_chatter_pager_btn': '_onClickPager', + 'click .o_portal_chatter_js_is_internal': 'async _onClickUpdateIsInternal', }, /** @@ -45,6 +46,7 @@ var PortalChatter = publicWidget.Widget.extend({ 'pager_scope': 5, 'pager_start': 1, 'is_user_public': true, + 'is_user_employee': false, 'is_user_publisher': false, 'hash': false, 'pid': false, @@ -254,6 +256,35 @@ var PortalChatter = publicWidget.Widget.extend({ var page = $(ev.currentTarget).data('page'); this._changeCurrentPage(page); }, + + /** + * Toggle is_internal state of message. Update both node data and + * classes to ensure DOM is updated accordingly to RPC call result. + * @private + * @returns {Promise} + */ + _onClickUpdateIsInternal: function (ev) { + ev.preventDefault(); + + var $elem = $(ev.currentTarget); + return this._rpc({ + route: '/mail/update_is_internal', + params: { + message_id: $elem.data('message-id'), + is_internal: ! $elem.data('is-internal'), + }, + }).then(function (result) { + $elem.data('is-internal', result); + if (result === true) { + $elem.addClass('o_portal_message_internal_on'); + $elem.removeClass('o_portal_message_internal_off'); + } + else { + $elem.addClass('o_portal_message_internal_off'); + $elem.removeClass('o_portal_message_internal_on'); + } + }); + }, }); publicWidget.registry.portalChatter = publicWidget.Widget.extend({ diff --git a/addons/portal/static/src/scss/portal.scss b/addons/portal/static/src/scss/portal.scss index 471dc7f9c8b..bd59bfc1419 100644 --- a/addons/portal/static/src/scss/portal.scss +++ b/addons/portal/static/src/scss/portal.scss @@ -524,4 +524,16 @@ form label { opacity: 1; } } + + .o_portal_message_internal_off { + .btn-danger { + display: none; + } + } + + .o_portal_message_internal_on { + .btn-success { + display: none; + } + } } diff --git a/addons/portal/static/src/xml/portal_chatter.xml b/addons/portal/static/src/xml/portal_chatter.xml index 520dc46eaa7..52a3d77c7bd 100644 --- a/addons/portal/static/src/xml/portal_chatter.xml +++ b/addons/portal/static/src/xml/portal_chatter.xml @@ -92,6 +92,7 @@
avatar
+
@@ -110,6 +111,18 @@
+ + +
+ + +
+
+
diff --git a/addons/rating/models/rating.py b/addons/rating/models/rating.py index 9e98d9af84b..fea471932dc 100644 --- a/addons/rating/models/rating.py +++ b/addons/rating/models/rating.py @@ -53,6 +53,7 @@ class Rating(models.Model): 'mail.message', string="Linked message", index=True, ondelete='cascade', help="Associated message when posting a review. Mainly used in website addons.") + is_internal = fields.Boolean('Employee Only', readonly=False, related='message_id.is_internal', store=True) access_token = fields.Char('Security Token', default=_default_access_token, help="Access token to set the rating of the value") consumed = fields.Boolean(string="Filled Rating", help="Enabled if the rating has been filled.") diff --git a/addons/rating/models/rating_mixin.py b/addons/rating/models/rating_mixin.py index 62fa232f12f..c95bc3d5ed1 100644 --- a/addons/rating/models/rating_mixin.py +++ b/addons/rating/models/rating_mixin.py @@ -134,7 +134,8 @@ class RatingMixin(models.AbstractModel): 'partner_id': partner.id, 'rated_partner_id': rated_partner.id, 'res_model_id': record_model_id, - 'res_id': self.id + 'res_id': self.id, + 'is_internal': False, }) else: rating = ratings[0] diff --git a/addons/website_mail/__manifest__.py b/addons/website_mail/__manifest__.py index fb4dc268da2..b91958c65f2 100644 --- a/addons/website_mail/__manifest__.py +++ b/addons/website_mail/__manifest__.py @@ -7,14 +7,12 @@ 'summary': 'Website Module for Mail', 'version': '0.1', 'description': """ -Module holding mail improvements for website. -It is responsible of comments moderation for published documents (forum, slides, blog, ...) +Module holding mail improvements for website. It holds the follow widget. """, 'depends': ['website', 'mail'], 'data': [ 'views/assets.xml', 'views/website_mail_templates.xml', - 'security/website_mail_security.xml', ], 'installable': True, 'auto_install': True, diff --git a/addons/website_mail/models/__init__.py b/addons/website_mail/models/__init__.py index 75ea63bd6d8..d138acf14cc 100644 --- a/addons/website_mail/models/__init__.py +++ b/addons/website_mail/models/__init__.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from . import mail_message from . import update diff --git a/addons/website_mail/models/mail_message.py b/addons/website_mail/models/mail_message.py deleted file mode 100644 index 2de32b9f4f0..00000000000 --- a/addons/website_mail/models/mail_message.py +++ /dev/null @@ -1,58 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -from odoo import api, fields, models, _ -from odoo.osv import expression -from odoo.exceptions import AccessError - - -class MailMessage(models.Model): - _inherit = 'mail.message' - - @api.model - def default_get(self, fields_list): - defaults = super(MailMessage, self).default_get(fields_list) - - # Note: explicitly implemented in default_get() instead of field default, - # to avoid setting to True for all existing messages during upgrades. - # TODO: this default should probably be dynamic according to the model - # on which the messages are attached, thus moved to create(). - if 'website_published' in fields_list: - defaults.setdefault('website_published', True) - - return defaults - - website_published = fields.Boolean(string='Published', help="Visible on the website as a comment", copy=False) - - @api.model - def _non_employee_message_domain(self): - domain = super(MailMessage, self)._non_employee_message_domain() - return expression.AND([domain, [('website_published', '=', True)]]) - - @api.model - def _search(self, args, offset=0, limit=None, order=None, count=False, access_rights_uid=None): - """ Override that adds specific access rights of mail.message, to restrict - messages to published messages for public users. """ - if self.user_has_groups('base.group_public'): - args = expression.AND([[('website_published', '=', True)], list(args)]) - - return super(MailMessage, self)._search(args, offset=offset, limit=limit, order=order, - count=count, access_rights_uid=access_rights_uid) - - def check_access_rule(self, operation): - """ Add Access rules of mail.message for non-employee user: - - read: - - raise if the type is comment and subtype NULL (internal note) - """ - if self.user_has_groups('base.group_public'): - self.env.cr.execute('SELECT id FROM "%s" WHERE website_published IS FALSE AND id = ANY (%%s)' % (self._table), (self.ids,)) - if self.env.cr.fetchall(): - raise AccessError( - _('The requested operation cannot be completed due to security restrictions. Please contact your system administrator.\n\n(Document type: %s, Operation: %s)') % (self._description, operation) - + ' - ({} {}, {} {})'.format(_('Records:'), self.ids[:6], _('User:'), self._uid) - ) - return super(MailMessage, self).check_access_rule(operation=operation) - - def _portal_message_format(self, fields_list): - fields_list += ['website_published'] - return super(MailMessage, self)._portal_message_format(fields_list) diff --git a/addons/website_mail/security/website_mail_security.xml b/addons/website_mail/security/website_mail_security.xml deleted file mode 100644 index d814fff16ef..00000000000 --- a/addons/website_mail/security/website_mail_security.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - mail.message: portal/public: read published messages - - [('website_published', '=', True)] - - - - - diff --git a/addons/website_mail/static/src/js/portal_chatter.js b/addons/website_mail/static/src/js/portal_chatter.js deleted file mode 100644 index 923c17032fe..00000000000 --- a/addons/website_mail/static/src/js/portal_chatter.js +++ /dev/null @@ -1,13 +0,0 @@ -odoo.define('website_mail.thread', function (require) { -'use strict'; - -var portalChatter = require('portal.chatter'); - -/** - * Extends Frontend Chatter to handle rating - */ -portalChatter.PortalChatter.include({ - xmlDependencies: (portalChatter.PortalChatter.prototype.xmlDependencies || []) - .concat(['/website_mail/static/src/xml/portal_chatter.xml']), -}); -}); diff --git a/addons/website_mail/static/src/xml/portal_chatter.xml b/addons/website_mail/static/src/xml/portal_chatter.xml deleted file mode 100644 index 70f51435c3b..00000000000 --- a/addons/website_mail/static/src/xml/portal_chatter.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - -
- - -
-
-
- - - - - - - - - - - - -
diff --git a/addons/website_mail/views/assets.xml b/addons/website_mail/views/assets.xml index 30d581cf4a4..c0c293a1b39 100644 --- a/addons/website_mail/views/assets.xml +++ b/addons/website_mail/views/assets.xml @@ -3,7 +3,6 @@ diff --git a/addons/website_rating/models/rating.py b/addons/website_rating/models/rating.py index 3c5f3586c59..bea77a45de9 100644 --- a/addons/website_rating/models/rating.py +++ b/addons/website_rating/models/rating.py @@ -6,8 +6,6 @@ from odoo import fields, models, exceptions, _ class Rating(models.Model): _inherit = 'rating.rating' - # Add this related field to mail.message for performance reason - website_published = fields.Boolean(related='message_id.website_published', store=True, readonly=False) # Adding information for comment a rating message publisher_comment = fields.Text("Publisher Comment") publisher_id = fields.Many2one('res.partner', 'Commented by', diff --git a/addons/website_sale/models/product.py b/addons/website_sale/models/product.py index 5d56b3a3a90..876f4cba8cf 100644 --- a/addons/website_sale/models/product.py +++ b/addons/website_sale/models/product.py @@ -372,7 +372,7 @@ class ProductTemplate(models.Model): def _rating_domain(self): """ Only take the published rating into account to compute avg and count """ domain = super(ProductTemplate, self)._rating_domain() - return expression.AND([domain, [('website_published', '=', True)]]) + return expression.AND([domain, [('is_internal', '=', False)]]) def _get_images(self): """Return a list of records implementing `image.mixin` to diff --git a/addons/website_slides/controllers/mail.py b/addons/website_slides/controllers/mail.py index 1940189a4d0..1d1c62bcee7 100644 --- a/addons/website_slides/controllers/mail.py +++ b/addons/website_slides/controllers/mail.py @@ -49,7 +49,7 @@ class SlidesPortalChatter(PortalChatter): domain = [ ('model', '=', res_model), ('res_id', '=', res_id), - ('website_published', '=', True), + ('is_internal', '=', False), ('author_id', '=', request.env.user.partner_id.id), ('message_type', '=', 'comment'), ('id', '=', message_id) @@ -64,7 +64,7 @@ class SlidesPortalChatter(PortalChatter): # update rating if post.get('rating_value'): - domain = [('res_model', '=', res_model), ('res_id', '=', res_id), ('website_published', '=', True), ('message_id', '=', message.id)] + domain = [('res_model', '=', res_model), ('res_id', '=', res_id), ('is_internal', '=', False), ('message_id', '=', message.id)] rating = request.env['rating.rating'].sudo().search(domain, order='write_date DESC', limit=1) rating.write({ 'rating': float(post['rating_value']) diff --git a/addons/website_slides/controllers/main.py b/addons/website_slides/controllers/main.py index d903d5f1ffa..e183045e062 100644 --- a/addons/website_slides/controllers/main.py +++ b/addons/website_slides/controllers/main.py @@ -433,7 +433,7 @@ class WebsiteSlides(WebsiteProfile): ('res_id', '=', channel.id), ('author_id', '=', request.env.user.partner_id.id), ('message_type', '=', 'comment'), - ('website_published', '=', True) + ('is_internal', '=', False) ], order='write_date DESC', limit=1) if last_message: last_message_values = last_message.read(['body', 'rating_value', 'attachment_ids'])[0] diff --git a/addons/website_slides/data/slide_user_demo.xml b/addons/website_slides/data/slide_user_demo.xml index 78cf6138884..95fcc2cbd67 100644 --- a/addons/website_slides/data/slide_user_demo.xml +++ b/addons/website_slides/data/slide_user_demo.xml @@ -42,7 +42,6 @@ slide.channel - comment
I fear beginners could be lost... Isn't it a bit harsh for a "basics" course ?
@@ -60,7 +59,6 @@ slide.channel - comment
Back to basics and interesting. Just WOW !
@@ -132,7 +130,6 @@ slide.channel - comment
Very good course.
@@ -150,7 +147,6 @@ slide.channel - comment
Interesting !
@@ -168,7 +164,6 @@ slide.channel - comment
Interesting. Could be great to include more examples.
diff --git a/addons/website_slides/models/slide_channel.py b/addons/website_slides/models/slide_channel.py index 90fa7898eb9..0c70cc82f47 100644 --- a/addons/website_slides/models/slide_channel.py +++ b/addons/website_slides/models/slide_channel.py @@ -539,7 +539,7 @@ class Channel(models.Model): def _rating_domain(self): """ Only take the published rating into account to compute avg and count """ domain = super(Channel, self)._rating_domain() - return expression.AND([domain, [('website_published', '=', True)]]) + return expression.AND([domain, [('is_internal', '=', False)]]) # --------------------------------------------------------- # Data / Misc