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, various: update notification emails computation and layouting #82167

Closed
wants to merge 23 commits into from

Conversation

tde-banana-odoo
Copy link
Contributor

@tde-banana-odoo tde-banana-odoo commented Jan 3, 2022

PURPOSE

Cleanup "Pay Now" notification template and their usage in "Send by email"
flows. Cleanup overall notification by email flow: rename methods, remove
outdated code, improve code clarity, prepare future improvements.

SPECIFICATIONS

Cleanup "Pay Npw" template: move buttons on the top, add subtitle, overall
cleaning of the content. It now looks more like the standard notification layout
with some model-based tweaks for invoices / SOs / POs, with less view-based
content.

Improve recipients computation: do it in batch, add more information when
fetching notification recipients information (follower status, lang, ...). Add tests.

Cleanup MailThread API and docstrings for notification methods. Improve flow
of values through notification methods. Make their purpose clearer.

Provide some master fixes for corner cases spotted while working on this
PR.

In any case see individual commits for more details as otherwise this message
would be a long concatenation of various purposes.

LINKS

Task-2712450 (Mail/Sale: Improve 'Pay Now' notification template)
Task-2726501 (Mail: Propagate message values in post methods)
Task-2732660 (Mail: Remove duplicate layout field on composer)
Task-2710804 (Mail: Clean Mail.Thread API)
Task-2739294 (Mail: Batch recipients fetch and improve its usage)

@robodoo
Copy link
Contributor

robodoo commented Jan 3, 2022

Pull request status dashboard

@C3POdoo C3POdoo requested review from a team January 3, 2022 15:36
@C3POdoo C3POdoo added the RD research & development, internal work label Jan 3, 2022
@tde-banana-odoo tde-banana-odoo force-pushed the master-notif-layout-tde branch 4 times, most recently from 0b1a6b6 to 8212db8 Compare January 6, 2022 16:23
@C3POdoo C3POdoo requested review from a team January 6, 2022 16:35
@Feyensv Feyensv marked this pull request as draft January 7, 2022 10:15
@tde-banana-odoo tde-banana-odoo force-pushed the master-notif-layout-tde branch 10 times, most recently from c4b69b1 to b28b76d Compare January 12, 2022 11:05
@tde-banana-odoo tde-banana-odoo force-pushed the master-notif-layout-tde branch 7 times, most recently from 2802109 to 27b643f Compare January 18, 2022 16:19
lordkrandel added a commit to odoo-dev/odoo that referenced this pull request Mar 9, 2022
… and customers

If applied, this PR will enable button_access for all users and portal_customers, letting them
access the documents directly. The button "View Journal Entries" will appear on the notification
email, and by clicking this the user will be directed to the portal page of the invoice/refund.
All users and portal_customers subscribed to the thread should be able to see this button.

A following refactor by TDE (odoo#82167) has addressed this problem in master (for 15.2).
For stable versions, in this PR, we agreed to keep changes limited to the accounting scope.

Ticket link: https://www.odoo.com/web#id=2645653&model=project.task

opw-2645653
robodoo pushed a commit that referenced this pull request Mar 10, 2022
… and customers

If applied, this PR will enable button_access for all users and portal_customers, letting them
access the documents directly. The button "View Journal Entries" will appear on the notification
email, and by clicking this the user will be directed to the portal page of the invoice/refund.
All users and portal_customers subscribed to the thread should be able to see this button.

A following refactor by TDE (#82167) has addressed this problem in master (for 15.2).
For stable versions, in this PR, we agreed to keep changes limited to the accounting scope.

Ticket link: https://www.odoo.com/web#id=2645653&model=project.task

opw-2645653

closes #82580

Signed-off-by: William André (wan) <wan@odoo.com>
lordkrandel added a commit to odoo-dev/odoo that referenced this pull request Mar 11, 2022
… and customers

If applied, this PR will enable button_access for all users and portal_customers, letting them
access the documents directly. The button "View Journal Entries" will appear on the notification
email, and by clicking this the user will be directed to the portal page of the invoice/refund.
All users and portal_customers subscribed to the thread should be able to see this button.

A following refactor by TDE (odoo#82167) has addressed this problem in master (for 15.2).
For stable versions, in this PR, we agreed to keep changes limited to the accounting scope.

Ticket link: https://www.odoo.com/web#id=2645653&model=project.task

opw-2645653

X-original-commit: de8d163
robodoo pushed a commit that referenced this pull request Mar 11, 2022
… and customers

If applied, this PR will enable button_access for all users and portal_customers, letting them
access the documents directly. The button "View Journal Entries" will appear on the notification
email, and by clicking this the user will be directed to the portal page of the invoice/refund.
All users and portal_customers subscribed to the thread should be able to see this button.

A following refactor by TDE (#82167) has addressed this problem in master (for 15.2).
For stable versions, in this PR, we agreed to keep changes limited to the accounting scope.

Ticket link: https://www.odoo.com/web#id=2645653&model=project.task

opw-2645653

closes #86214

X-original-commit: de8d163
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Paolo Gatti (pgi) <pgi@odoo.com>
lordkrandel added a commit to odoo-dev/odoo that referenced this pull request Mar 11, 2022
… and customers

If applied, this PR will enable button_access for all users and portal_customers, letting them
access the documents directly. The button "View Journal Entries" will appear on the notification
email, and by clicking this the user will be directed to the portal page of the invoice/refund.
All users and portal_customers subscribed to the thread should be able to see this button.

A following refactor by TDE (odoo#82167) has addressed this problem in master (for 15.2).
For stable versions, in this PR, we agreed to keep changes limited to the accounting scope.

Ticket link: https://www.odoo.com/web#id=2645653&model=project.task

opw-2645653

X-original-commit: 1ef5fa4
robodoo pushed a commit that referenced this pull request Mar 11, 2022
… and customers

If applied, this PR will enable button_access for all users and portal_customers, letting them
access the documents directly. The button "View Journal Entries" will appear on the notification
email, and by clicking this the user will be directed to the portal page of the invoice/refund.
All users and portal_customers subscribed to the thread should be able to see this button.

A following refactor by TDE (#82167) has addressed this problem in master (for 15.2).
For stable versions, in this PR, we agreed to keep changes limited to the accounting scope.

Ticket link: https://www.odoo.com/web#id=2645653&model=project.task

opw-2645653

closes #86253

X-original-commit: 1ef5fa4
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Paolo Gatti (pgi) <pgi@odoo.com>
fw-bot pushed a commit to odoo-dev/odoo that referenced this pull request Mar 11, 2022
… and customers

If applied, this PR will enable button_access for all users and portal_customers, letting them
access the documents directly. The button "View Journal Entries" will appear on the notification
email, and by clicking this the user will be directed to the portal page of the invoice/refund.
All users and portal_customers subscribed to the thread should be able to see this button.

A following refactor by TDE (odoo#82167) has addressed this problem in master (for 15.2).
For stable versions, in this PR, we agreed to keep changes limited to the accounting scope.

Ticket link: https://www.odoo.com/web#id=2645653&model=project.task

opw-2645653

X-original-commit: 71b0ea2
robodoo pushed a commit that referenced this pull request Mar 11, 2022
… and customers

If applied, this PR will enable button_access for all users and portal_customers, letting them
access the documents directly. The button "View Journal Entries" will appear on the notification
email, and by clicking this the user will be directed to the portal page of the invoice/refund.
All users and portal_customers subscribed to the thread should be able to see this button.

A following refactor by TDE (#82167) has addressed this problem in master (for 15.2).
For stable versions, in this PR, we agreed to keep changes limited to the accounting scope.

Ticket link: https://www.odoo.com/web#id=2645653&model=project.task

opw-2645653

closes #86308

X-original-commit: 71b0ea2
Signed-off-by: Paolo Gatti (pgi) <pgi@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
flch-odoo added a commit to odoo-dev/odoo that referenced this pull request Mar 14, 2022
Improve the design of SO/PO/INV mails together with the other changes of the
release, i.e. fixes a few imprecisions introduced by odoo#82167.

In particular, these changes enforce
* a responsive, mobile friendly layout tested on many devices and OS
* more generally, a consistent styling. Note that some redundancy in directives
 is required for compatibility across email clients.

Translation files are included.

Task-2751139
Follow-up of Task-2712450
See odoo/enterprise#25154
robodoo pushed a commit that referenced this pull request Mar 16, 2022
Improve the design of SO/PO/INV mails together with the other changes of the
release, i.e. fixes a few imprecisions introduced by #82167.

In particular, these changes enforce
* a responsive, mobile friendly layout tested on many devices and OS
* more generally, a consistent styling. Note that some redundancy in directives
 is required for compatibility across email clients.

Translation files are included.

Task-2751139
Follow-up of Task-2712450
See odoo/enterprise#25154

closes #83977

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
fw-bot pushed a commit to odoo-dev/odoo that referenced this pull request Mar 16, 2022
Improve the design of SO/PO/INV mails together with the other changes of the
release, i.e. fixes a few imprecisions introduced by odoo#82167.

In particular, these changes enforce
* a responsive, mobile friendly layout tested on many devices and OS
* more generally, a consistent styling. Note that some redundancy in directives
 is required for compatibility across email clients.

Translation files are included.

Task-2751139
Follow-up of Task-2712450
See odoo/enterprise#25154

X-original-commit: 4914127
robodoo pushed a commit that referenced this pull request Mar 16, 2022
Improve the design of SO/PO/INV mails together with the other changes of the
release, i.e. fixes a few imprecisions introduced by #82167.

In particular, these changes enforce
* a responsive, mobile friendly layout tested on many devices and OS
* more generally, a consistent styling. Note that some redundancy in directives
 is required for compatibility across email clients.

Translation files are included.

Task-2751139
Follow-up of Task-2712450
See odoo/enterprise#25154

closes #86494

X-original-commit: 4914127
Related: odoo/enterprise#25306
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
b-enoit-be pushed a commit to haulogy/odoo that referenced this pull request Apr 14, 2022
… and customers

If applied, this PR will enable button_access for all users and portal_customers, letting them
access the documents directly. The button "View Journal Entries" will appear on the notification
email, and by clicking this the user will be directed to the portal page of the invoice/refund.
All users and portal_customers subscribed to the thread should be able to see this button.

A following refactor by TDE (odoo#82167) has addressed this problem in master (for 15.2).
For stable versions, in this PR, we agreed to keep changes limited to the accounting scope.

Ticket link: https://www.odoo.com/web#id=2645653&model=project.task

opw-2645653

closes odoo#82580

Signed-off-by: William André (wan) <wan@odoo.com>
odooaktiv pushed a commit to odooaktiv/odoo that referenced this pull request Jun 13, 2022
… and customers

If applied, this PR will enable button_access for all users and portal_customers, letting them
access the documents directly. The button "View Journal Entries" will appear on the notification
email, and by clicking this the user will be directed to the portal page of the invoice/refund.
All users and portal_customers subscribed to the thread should be able to see this button.

A following refactor by TDE (odoo#82167) has addressed this problem in master (for 15.2).
For stable versions, in this PR, we agreed to keep changes limited to the accounting scope.

Ticket link: https://www.odoo.com/web#id=2645653&model=project.task

opw-2645653

closes odoo#86214

X-original-commit: de8d163
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Paolo Gatti (pgi) <pgi@odoo.com>
cormaza pushed a commit to cormaza/odoo that referenced this pull request Jul 15, 2022
… and customers

If applied, this PR will enable button_access for all users and portal_customers, letting them
access the documents directly. The button "View Journal Entries" will appear on the notification
email, and by clicking this the user will be directed to the portal page of the invoice/refund.
All users and portal_customers subscribed to the thread should be able to see this button.

A following refactor by TDE (odoo#82167) has addressed this problem in master (for 15.2).
For stable versions, in this PR, we agreed to keep changes limited to the accounting scope.

Ticket link: https://www.odoo.com/web#id=2645653&model=project.task

opw-2645653

closes odoo#82580

Signed-off-by: William André (wan) <wan@odoo.com>
robodoo added a commit that referenced this pull request Jan 17, 2023
…rformances

Purpose of this task is to cleanup usage of main mail.thread post methods and
helpers as well as composer usage and code. Achieve this by removing or
cleaning deprecated code, simplifying flow / API, improving composer support
of templates, rewrite composer code, ease batch support.

In this task we notably

  * cleanup input / output as well as default values for message_post as well
    as 'with view' and 'with template' helpers. Those are now cleaned and
    two main helpers are introduced: post with source (view or template)
    and mail with source (view or template), depending on main notification
    style.
  * rewrite and improve template code generating values from the template
    definition. It is now cleaner, delegated into sub methods and made
    more efficient in batch mode, notably when computing or creating
    recipients;
  * rewrite and improve composer code generating values for either posting
    either sending a mass mailing. It is now better separated into a static
    rendering and a dynamic rendering;
  * supports a batch post on documents, instead of being limited to a single
     res_id and improve overall code to be batch-enabled;
  * support scheduled_date from template;
  * support multi reports templates;
  * perform various code cleaning, rewriting in order to achieve both a more
    readable code, easier to override and understand as well as better tested
    and documented;
  * cleanup configuration of composer. Use fields, better define and update
    their value. Don't add them in UI but allow more fine-grain usage, notably
    when invoked in code;

METHODOLOGY NOTE

Several points are linked to different tasks. A big PR containing a cleaning
and some improvements in the composer behavior, usage and definition allowed
to ease testing and review.

This PR is build on previously merged content that originated form this PR.
See notably (but not limited to)

  * account, mail, sale: properly locate code
    Task-2792146 - #106658
  * various: cleanup alias usage and empty list help overrides
    Task-3074358 - #105992
  * clean parameters propagation in post methods
    Task-2726501 - #82167
  * rating send request api cleanup
    #106024
  * empty list help cleanup
    Task-3074357 - #105992
  * rendering mixin options and usage cleanup
    #106072
  * improve exclusion list mail logging
    #106568
  * linting and cleaning
    #106025

Next step will be to improve composer fields to be editable computed fields
and remove the onchange and hard-to-predict code. Translation support will
also be improved, as well as some performance bits.

LINKS

Task-2710804 (Mail: Clean MailThread API)
Task-2993872 (Mail: Support scheduled date in all composer flows)
Task-3035101 (Mail: Support batch-posting from composer)
Task-3034875 (Mail: Speedup and batch partners find or create with templates)
Task-2868153 (Mail: Allow multi-reports mail templates)
Task-3132710 (Mail: Configurable composer)

Prepares Task-2088884 (Mail: Use editable computed stored fields in composer)
Prepares Task-36879 (Mail: Support MultiCompany Aliases)

closes #99482

Related: odoo/upgrade#3856
Related: odoo/enterprise#31017
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
15.2 RD research & development, internal work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants