Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MERGE] mail: move website part of message and rating to mail / portal #38692

Closed
wants to merge 8 commits into from

Conversation

@tde-banana-odoo
Copy link
Contributor

tde-banana-odoo commented Oct 14, 2019

PURPOSE

Clean posting process and improve mail.message definition and comprehension.
Move as much possible content from website_* modules to portal_* modules
to ease their use in customer portal without having to depend on website.

SPECIFICATIONS: MAIL.MESSAGE DESCRIPTION

Move description from website_mail directly to mail. Anyway it is a
non stored computed field and therefore having it available directly
in mail does not cost anything.

SPECIFICATIONS: MAIL.MESSAGE WEBSITE PUBLISHED

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 merge 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.

Also rename subtype parameter of message_post to subtype_xmlid. In
order to be more explicit subtype parameter is renamed to subtype_xmlid.
It therefore clearly indicates it should be a valid subtype Xml ID. Support
of ill formatted Xml IDs is removed because there is no reason to try to
add some random prefix. Give something that exists or go to hell, punk !

Finally mail.message and rating.rating form views are updated to include
is_internal flag and perform some view cleaning. An entry of ratings in
Technical/Discuss is added for debugging / management purpose.

SPECIFICATIONS: MOVE WEBSITE RATING TO PORTAL RATING

Now that publish feature is replaced by internal directly in mail and portal
rating portal inclusion can be done safely in a portal_rating module instead
of website_rating. It allows to remove the dependency and give the rating
feature of customer chatter directly in portal applications.

LINKS

Task ID 2071556
PR #38692

@robodoo robodoo added the seen 🙂 label Oct 14, 2019
@tde-banana-odoo tde-banana-odoo force-pushed the odoo-dev:master-msg-fields-tde branch 2 times, most recently from d7caf28 to 7eb057e Oct 14, 2019
@C3POdoo C3POdoo added the RD label Oct 14, 2019
@tde-banana-odoo tde-banana-odoo force-pushed the odoo-dev:master-msg-fields-tde branch 3 times, most recently from ea35395 to e985a86 Oct 14, 2019
@tde-banana-odoo tde-banana-odoo force-pushed the odoo-dev:master-msg-fields-tde branch from e985a86 to d79acba Oct 24, 2019
tde-banana-odoo added a commit to odoo-dev/odoo that referenced this pull request Oct 24, 2019
In order ot be more explicit parameter is renamed. It should also be now
correctly formatted instead of supporting badly formatted one (missing
module prefix). Finally we will orm cache some subtype information as this
should speedup a bit posting process.

Task ID 2071556
PR odoo#38692
@tde-banana-odoo tde-banana-odoo force-pushed the odoo-dev:master-msg-fields-tde branch from d79acba to f4a1c7a Oct 24, 2019
tde-banana-odoo added a commit to odoo-dev/odoo that referenced this pull request Oct 24, 2019
In order ot be more explicit parameter is renamed. It should also be now
correctly formatted instead of supporting badly formatted one (missing
module prefix). Finally we will orm cache some subtype information as this
should speedup a bit posting process.

Task ID 2071556
PR odoo#38692
@tde-banana-odoo tde-banana-odoo force-pushed the odoo-dev:master-msg-fields-tde branch 2 times, most recently from 0f3cddd to 1f96c11 Oct 24, 2019
tde-banana-odoo added a commit to odoo-dev/odoo that referenced this pull request Oct 24, 2019
PURPOSE

Purpose of this commit is to simplify message model.

SPECIFICATIONS

Define an 'internal' field on mail.message that tells if share people
(customers, share users) can see the message. If not given when giving a
subtype, propagate subtype internal field value.

Remove the website published feature on mail.message in website_mail. Update
it in portal to directly work on internal field.

Update rating field naming accordingly.

LINKS

Task ID 2071556
PR odoo#38692
@tde-banana-odoo tde-banana-odoo force-pushed the odoo-dev:master-msg-fields-tde branch from 1f96c11 to a83ae7d Oct 24, 2019
tde-banana-odoo added a commit to odoo-dev/odoo that referenced this pull request Oct 24, 2019
PURPOSE

Purpose of this commit is to simplify message model.

SPECIFICATIONS

Define an 'internal' field on mail.message that tells if share people
(customers, share users) can see the message. If not given when giving a
subtype, propagate subtype internal field value.

Remove the website published feature on mail.message in website_mail. Update
it in portal to directly work on internal field.

Update rating field naming accordingly.

LINKS

Task ID 2071556
PR odoo#38692
@tde-banana-odoo tde-banana-odoo force-pushed the odoo-dev:master-msg-fields-tde branch from 699fb10 to bfc0ad7 Oct 24, 2019
tde-banana-odoo added a commit to odoo-dev/odoo that referenced this pull request Oct 24, 2019
PURPOSE

Purpose of this commit is to simplify message model.

SPECIFICATIONS

Define an 'internal' field on mail.message that tells if share people
(customers, share users) can see the message. If not given when giving a
subtype, propagate subtype internal field value.

Remove the website published feature on mail.message in website_mail. Update
it in portal to directly work on internal field.

Update rating field naming accordingly.

LINKS

Task ID 2071556
PR odoo#38692
@tde-banana-odoo tde-banana-odoo force-pushed the odoo-dev:master-msg-fields-tde branch from ea0c9f6 to b601568 Oct 24, 2019
Copy link
Contributor

seb-odoo left a comment

Quick look at first commit "rename subtype" + commit message typo ot be.

addons/mail/models/mail_message_subtype.py Outdated Show resolved Hide resolved
addons/mail/models/mail_thread.py Outdated Show resolved Hide resolved
@robodoo robodoo added the CI 🤖 label Oct 24, 2019
Copy link
Contributor

seb-odoo left a comment

Review of "replace published field WIP " commit: overall a good idea!

Some remarks below

addons/mail/models/mail_message.py Outdated Show resolved Hide resolved
addons/mail/models/mail_message.py Outdated Show resolved Hide resolved
addons/mail/models/mail_thread.py Outdated Show resolved Hide resolved
addons/mail/models/mail_thread.py Outdated Show resolved Hide resolved
addons/portal/controllers/mail.py Outdated Show resolved Hide resolved
addons/portal/static/src/js/portal_chatter.js Outdated Show resolved Hide resolved
addons/portal/static/src/js/portal_chatter.js Outdated Show resolved Hide resolved
addons/portal/static/src/js/portal_chatter.js Outdated Show resolved Hide resolved
addons/rating/models/rating.py Outdated Show resolved Hide resolved
@KangOl KangOl force-pushed the odoo:master branch from 86c80d3 to ab6d0c3 Nov 6, 2019
tde-banana-odoo added a commit to odoo-dev/odoo that referenced this pull request Nov 6, 2019
PURPOSE

Clean posting process and improve mail.message definition and comprehension.

SPECIFICATIONS

In order to be more explicit subtype parameter is renamed to subtype_xmlid.
It therefore clearly indicates it should be a valid subtype xml id. Support
of ill formatted xml IDs is removed because there is no reason to try to
add some random prefix.

LINKS

Task ID 2071556
PR odoo#38692
tde-banana-odoo added a commit to odoo-dev/odoo that referenced this pull request Nov 6, 2019
… in mail

PURPOSE

Clean posting process and improve mail.message definition and comprehension.

SPECIFCIATIONS

Move description from website_mail directly to mail. Anyway it is a
non stored computed field and therefore having it available directly
in mail does not cost anything.

LINKS

Task ID 2071556
PR odoo#38692
tde-banana-odoo added a commit to odoo-dev/odoo that referenced this pull request Nov 6, 2019
…e 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.

Define an 'internal' field on mail.message that tells if share people
(customers, share users) can see the message. If not given when giving a
subtype, propagate subtype internal field value.

Remove the website published feature on mail.message in website_mail. Update
it in portal to directly work on internal field.

Update rating field naming accordingly.

It should also be now
correctly formatted instead of supporting badly formatted one (missing
module prefix). Finally we will orm cache some subtype information as this
should speedup a bit posting process.

LINKS

Task ID 2071556
PR odoo#38692
@tde-banana-odoo tde-banana-odoo force-pushed the odoo-dev:master-msg-fields-tde branch from b601568 to fdfa5a8 Nov 6, 2019
@robodoo robodoo removed the CI 🤖 label Nov 6, 2019
tde-banana-odoo added a commit to odoo-dev/odoo that referenced this pull request Nov 6, 2019
…ype_xmlid

PURPOSE

Clean posting process and improve mail.message definition and comprehension.

SPECIFICATIONS

In order to be more explicit subtype parameter is renamed to subtype_xmlid.
It therefore clearly indicates it should be a valid subtype Xml ID. Support
of ill formatted Xml IDs is removed because there is no reason to try to
add some random prefix. Give something that exists or go to hell, punk !

LINKS

Task ID 2071556
PR odoo#38692
Purpose of this commit is to add some missing fields in message view, notably
is_internal newly added flag and its ratings. Rating form view is also
updated to display is_internal flag, and form view is a bit reorganized.

Task ID 2071556
PR #38692
@tde-banana-odoo tde-banana-odoo force-pushed the odoo-dev:master-msg-fields-tde branch from caf3a41 to bce5620 Dec 2, 2019
@tde-banana-odoo

This comment has been minimized.

Copy link
Contributor Author

tde-banana-odoo commented Dec 2, 2019

@robodoo r+ rebase-merge

@robodoo robodoo added the r+ 👌 label Dec 2, 2019
@robodoo

This comment has been minimized.

Copy link
Contributor

robodoo commented Dec 2, 2019

Merge method set to rebase and merge, using the PR as merge commit message

@robodoo robodoo added the CI 🤖 label Dec 2, 2019
@robodoo

This comment has been minimized.

Copy link
Contributor

robodoo commented Dec 2, 2019

Linked pull request(s) odoo/enterprise#6410 not ready. Linked PRs are not staged until all of them are ready.

robodoo pushed a commit that referenced this pull request Dec 2, 2019
… groups for notification

Some override of ``_notify_classify_recipients`` may not check that groups
is None and expect a (maybe void) list.

Task ID 2071556
PR #38692
robodoo pushed a commit that referenced this pull request Dec 2, 2019
…ype_xmlid

PURPOSE

Clean posting process and improve mail.message definition and comprehension.

SPECIFICATIONS

In order to be more explicit subtype parameter is renamed to subtype_xmlid.
It therefore clearly indicates it should be a valid subtype Xml ID. Support
of ill formatted Xml IDs is removed because there is no reason to try to
add some random prefix. Give something that exists or go to hell, punk !

LINKS

Task ID 2071556
PR #38692
robodoo pushed a commit that referenced this pull request Dec 2, 2019
… in mail

PURPOSE

Clean posting process and improve mail.message definition and comprehension.

SPECIFCIATIONS

Move description from website_mail directly to mail. Anyway it is a
non stored computed field and therefore having it available directly
in mail does not cost anything.

LINKS

Task ID 2071556
PR #38692
robodoo pushed a commit that referenced this pull request Dec 2, 2019
…e 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
robodoo pushed a commit that referenced this pull request Dec 2, 2019
PURPOSE

Clean posting process and improve mail.message definition and comprehension.

SPECIFICATIONS

In this commit we use the is_internal flag to correctly propagate it from
mail gateway and clean some parent check. In this commit some code is cleaned.
No functional change should occur with this commit.

LINKS

Task ID 2071556
PR #38692
robodoo pushed a commit that referenced this pull request Dec 2, 2019
PURPOSE

Clean posting process and improve mail.message definition and comprehension.
Move as much possible content from website_* modules to portal_* modules
to ease their use in customer portal

SPECIFICATIONS

Now that publish feature is replaced by internal directly in mail and portal
rating portal inclusion can be done safely in a portal_ratign module instead
of website_rating. It allows to remove the dependency and give the rating
feature of customer chatter directly in portal applications.

LINKS

Task ID 2071556
PR #38692
robodoo pushed a commit that referenced this pull request Dec 2, 2019
PURPOSE

Clean posting process and improve mail.message definition and comprehension.
Move as much possible content from website_* modules to portal_* modules
to ease their use in customer portal

SPECIFICATIONS

Now that website_rating is now portal_rating, let us update translations
files accordingly.

LINKS

Task ID 2071556
PR #38692
robodoo pushed a commit that referenced this pull request Dec 2, 2019
Purpose of this commit is to add some missing fields in message view, notably
is_internal newly added flag and its ratings. Rating form view is also
updated to display is_internal flag, and form view is a bit reorganized.

Task ID 2071556
PR #38692
robodoo added a commit that referenced this pull request Dec 2, 2019
PURPOSE

Clean posting process and improve mail.message definition and comprehension.
Move as much possible content from website_* modules to portal_* modules
to ease their use in customer portal without having to depend on website.

SPECIFICATIONS: MAIL.MESSAGE DESCRIPTION

Move description from website_mail directly to mail. Anyway it is a
non stored computed field and therefore having it available directly
in mail does not cost anything.

SPECIFICATIONS: MAIL.MESSAGE WEBSITE PUBLISHED

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 merge 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.

Also rename subtype parameter of message_post to subtype_xmlid. In
order to be more explicit subtype parameter is renamed to subtype_xmlid.
It therefore clearly indicates it should be a valid subtype Xml ID. Support
of ill formatted Xml IDs is removed because there is no reason to try to
add some random prefix. Give something that exists or go to hell, punk !

Finally mail.message and rating.rating form views are updated to include
is_internal flag and perform some view cleaning. An entry of ratings in
Technical/Discuss is added for debugging / management purpose.

SPECIFICATIONS: MOVE WEBSITE RATING TO PORTAL RATING

Now that publish feature is replaced by internal directly in mail and portal
rating portal inclusion can be done safely in a portal_rating module instead
of website_rating. It allows to remove the dependency and give the rating
feature of customer chatter directly in portal applications.

LINKS

Task ID 2071556
PR #38692

Related: odoo/enterprise#6410
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
@robodoo robodoo closed this Dec 2, 2019
@robodoo robodoo deployed to merge Dec 2, 2019 Active
@tde-banana-odoo tde-banana-odoo deleted the odoo-dev:master-msg-fields-tde branch Dec 9, 2019
bbh-odoo added a commit to odoo-dev/odoo that referenced this pull request Dec 9, 2019
… groups for notification

Some override of ``_notify_classify_recipients`` may not check that groups
is None and expect a (maybe void) list.

Task ID 2071556
PR odoo#38692
bbh-odoo added a commit to odoo-dev/odoo that referenced this pull request Dec 9, 2019
…ype_xmlid

PURPOSE

Clean posting process and improve mail.message definition and comprehension.

SPECIFICATIONS

In order to be more explicit subtype parameter is renamed to subtype_xmlid.
It therefore clearly indicates it should be a valid subtype Xml ID. Support
of ill formatted Xml IDs is removed because there is no reason to try to
add some random prefix. Give something that exists or go to hell, punk !

LINKS

Task ID 2071556
PR odoo#38692
bbh-odoo added a commit to odoo-dev/odoo that referenced this pull request Dec 9, 2019
… in mail

PURPOSE

Clean posting process and improve mail.message definition and comprehension.

SPECIFCIATIONS

Move description from website_mail directly to mail. Anyway it is a
non stored computed field and therefore having it available directly
in mail does not cost anything.

LINKS

Task ID 2071556
PR odoo#38692
bbh-odoo added a commit to odoo-dev/odoo that referenced this pull request Dec 9, 2019
…e 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 odoo#38692
bbh-odoo added a commit to odoo-dev/odoo that referenced this pull request Dec 9, 2019
PURPOSE

Clean posting process and improve mail.message definition and comprehension.

SPECIFICATIONS

In this commit we use the is_internal flag to correctly propagate it from
mail gateway and clean some parent check. In this commit some code is cleaned.
No functional change should occur with this commit.

LINKS

Task ID 2071556
PR odoo#38692
bbh-odoo added a commit to odoo-dev/odoo that referenced this pull request Dec 9, 2019
PURPOSE

Clean posting process and improve mail.message definition and comprehension.
Move as much possible content from website_* modules to portal_* modules
to ease their use in customer portal

SPECIFICATIONS

Now that publish feature is replaced by internal directly in mail and portal
rating portal inclusion can be done safely in a portal_ratign module instead
of website_rating. It allows to remove the dependency and give the rating
feature of customer chatter directly in portal applications.

LINKS

Task ID 2071556
PR odoo#38692
bbh-odoo added a commit to odoo-dev/odoo that referenced this pull request Dec 9, 2019
PURPOSE

Clean posting process and improve mail.message definition and comprehension.
Move as much possible content from website_* modules to portal_* modules
to ease their use in customer portal

SPECIFICATIONS

Now that website_rating is now portal_rating, let us update translations
files accordingly.

LINKS

Task ID 2071556
PR odoo#38692
bbh-odoo added a commit to odoo-dev/odoo that referenced this pull request Dec 9, 2019
Purpose of this commit is to add some missing fields in message view, notably
is_internal newly added flag and its ratings. Rating form view is also
updated to display is_internal flag, and form view is a bit reorganized.

Task ID 2071556
PR odoo#38692
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.