summaryrefslogtreecommitdiff
path: root/addons/website_slides/models
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2019-10-14 11:05:55 +0000
committerThibault Delavallée <tde@odoo.com>2019-12-02 15:18:44 +0000
commit5649fc88e8f3022f4143400a124f2e3c1e5c0df8 (patch)
treecb172be462e568baca8235f7af13855733cfaf8b /addons/website_slides/models
parent46b9a97b56d74503d6e86b16466982c750a66422 (diff)
[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
Diffstat (limited to 'addons/website_slides/models')
-rw-r--r--addons/website_slides/models/slide_channel.py2
1 files changed, 1 insertions, 1 deletions
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