Commit Graph
14 Commits
Author SHA1 Message Date
std-odoo efc407fe03 [FIX] mail_group: add missing SMTP headers
Bug
===
Since 2d359b909b we moved the mailing
list feature of the <mail.channel> in a different model, <mail.group>.

During this split, some SMTP headers have been forgotten.

Task-2721009

closes odoo/odoo#81887

X-original-commit: daf9c0300fb042891c019e4f2a8c5395de388e1c
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-12-24 09:52:42 +00:00
Martin Trigaux bf460685fc [FIX] mail_group: display the date of the message
This will avoid spending half hour hunting why an inactive employee
was sendig a spam before realising it was from 2 years ago (true
story)

Modify the tree view to be coherent

closes odoo/odoo#81219

X-original-commit: cb3e34db1b2ce6ffe82ee15cc21ded9bbac91062
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-12-10 12:49:55 +00:00
Jeremy Kersten 685c76aad2 [FIX] mail_group: only check members based on email and no author_id
In v15, in _find_members, we try to find a members with an email and without
partner_id or a member with the partner_id provided (if provided).

This commit remove the author_id, and so the partner_id to only looking for
members based on their email address.

Author_id could be the wrong since email is not uniq on partner.
We retrieve the same behavior than previously from this way.

courtesy of std for help to find a solution

closes odoo/odoo#80638

X-original-commit: 98d7b1417ee82fefcef175dd83ab41cd89db5119
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-12-02 10:19:00 +00:00
Martin Trigaux a0548c65b5 [FIX] mail_group: avoid "Re: False" reply
If the subject is not set, the wizard set the subject as "Re: False"

closes odoo/odoo#80372

X-original-commit: 169775419e0f14723c19ff5f14e0907c179721d9
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-11-25 10:51:45 +00:00
Csaba Tóth b419a0a2f1 [FIX] mail_group: Syntax error
This is a one liner fix.

closes odoo/odoo#79799

X-original-commit: 9b2a8005712454bb17858fb6ea2f07740d4e4d04
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-11-16 08:20:34 +00:00
Thibault Delavallée f9dbd38720 [IMP] mail, various: rename custom_layout / notif_layout context usage
RATIONALE

Currently we can specify email used for notification layouting through context
use in mail composer. It is then propagated to message_post, stored on
mail.message and used to encapsulate emails sent based on posted messages.

SPECIFICATIONS

On template model: rename ``notif_layout`` parameter of ``send_mail`` to
``email_layout_xmlid`` to be coherent with naming used in other parts of the
code. Moreover it better indicates we expect an xml id.

On rating model: rename ``notif_layout`` parameter of ``rating_send_request``
to ``email_layout_xmlid``, for the same reasons as above.

In various wizards: support ``email_layout_xmlid`` context key when no field
is available, notably because this is still done manually in some wizards
like survey invite. Keep a fallback on ``notif_layout`` but remove support of
``custom_layout`` deprecated since quite a long time.

Task-2621326 (Mail: add 'view' button in 'light notification template')
Task-2647302 (Mail: add layout field in composer)

Part-of: odoo/odoo#76418
2021-11-10 09:58:09 +00:00
Martin Trigaux e132c36ee6 [I18N] *: export 15.0 source terms
closes odoo/odoo#77898

X-original-commit: ad5afb1d18661784bfcf51bca66e576de1f6c49b
Related: odoo/enterprise#21478
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-10-05 16:54:21 +00:00
Nicolas Bayet 4813f42997 [IMP] mail,*: replace jinja with qweb
Jinja as a templating engine was problematic in differents respect:
- introduce external dependency to Odoo (less controll)
- add another templating mechanism in the stack
- specific feature in qweb cannot be reused
- difficulty in rendering easily editable templates
- more knowledge required with no betterment

By replacing jinja with qweb we can now build tools to edit a qweb
that will work with the previously jinja encoded document
(essentially `mail.template` records).

There is a catch however. Some email fields (eg. email_to) used jinja
syntax for rendering dynamic variables (ie. ${object.something} and
${object.something_that_should_not_be_escaped | safe}).

We still want user to use dynamic variables for some char fields (eg.
subject, from, to, ...). We made a new rendering engine called
"inline_template" that will render an expression enclosed by `{{` and
`}}`.

To be able to edit the templates from the backend interface, a
plugin to the Odoo editor has been made for seamlessly edit the
document.

This qweb plugin includes:
- make dynamic variables (eg. `<t t-out="variable"/>`) not editable
  (for preventing the user to shoot himself in the foot)
- group and hide related logical branching (ie. t-if, t-elif, and t-else)
  in order to see only one at once
- a floating select input to switch visibility of a particular logical
  branching

Task-27033

X-original-commit: odoo/odoo@68182baff4
Part-of: odoo/odoo#77377
2021-09-28 23:42:54 +00:00
Martin Trigaux ef8ad324b0 [I18N] *: export 15.0 source terms
closes odoo/odoo#76542

X-original-commit: 63e6807437295519a0f4705fb88644d6d557ca3a
Related: odoo/enterprise#20882
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-09-16 07:17:40 +00:00
std-odoo 322ed33d42 [IMP] mail_group: improve the UI and misc improvements
Purpose
=======
This commit improves the UI of the mail group module (backend and portal
view), fix some bugs and clean the code.

Bug 1
=====
If a user click 2 times on a confirmation link, an error is raised.

Bug 2
=====
A bug about the website snippets has been fixed;
- Add the snippet to a group in which you are member
- Change the group of the snippet to a group in which you are not member
- The snippet still show "Unsubscribe"

Bug 3
=====
In the portal view, when messages are filtered by month, messages which
are created in the last day of the month appear also in the next month.

Specification
=============
UI
--
Show the Allow / Ban buttons whatever is the state of the message, so
the user can ban / whitelist a message even if there's no pending email.

When we receive an email, remove the "Mailing List" footer. This was a
big issue because when some users reply many times, the footer was
duplicated on each answer.

Improve the form view of the mail group:
- On non-moderated group, show all messages instead of only pending
  message
- Show the guidelines stuff on non-moderated groups

Improve the portal view
- show the attachments under every message (not only on opened message)
- improve the template to confirm the subscription of the user
- improve the portal view for mobile device
- do not show rejected messages, even for admin
- do not show the button "X replies" when the mode is not thread

Technical
---------
Split the route "/groups/subscription" into "/group/subscribe" and
"/group/unsubscribe"

Correctly quote the parent email for the emails sent by web version of
Outlook (with the HTML id "divRplyFwdMsg").

ACLs
----
Now only administrators or responsible / moderators can write / unlink
the group.

Fix an ACL issue on the group member where the responsible of a
non-moderated group could not access the members of the group.

Members with same email
-----------------------

Improve the behavior when multiple members have the same email address
(this situation is possible because there's no unique constraint on the
email field of the <res.partner> model.) We now return the most
appropriate member for the given email address and partner.

When unsubscribing by clicking on the confirmation link that we received
by email, remove all members with the same email address.

Links
=====
Task-2599676
See odoo/odoo/pull/73640

closes odoo/odoo#73640

Related: odoo/upgrade#2774
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-09-01 19:07:48 +00:00
std-odoo 366cf243ac [FIX] mail_group: fix a traceback when a public user subscribe
When a public user subscribe to a mailing list, a traceback is raised.
Introduced with refactroring odoo/odoo@2d359b909b

Task-2599676

Part-of: odoo/odoo#75770
2021-08-31 08:47:27 +00:00
Xavier-Do 288595f558 [FIX] *: add explicit license to all manifest
The license is missing in most enterprise manifest so
the decision was taken to make it explicit in all cases.
When not defined, a warning will be triggered starting from
14.0 when falling back on the default LGPL-3.

closes odoo/odoo#74245

Related: odoo/design-themes#48
Related: odoo/enterprise#19862
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2021-07-26 13:09:57 +00:00
std-odoo 8b814947d3 [ADD] website_mail_group: re-add the <mail.group> website snippets
Purpose
=======

This snippets was originally in the "Website Mail Channel" module,
but it has been removed.

The snippet allow the user to subscribe to a specific mailing list.

If the current user has no access to the mailing list (because of ACL
rule) the widget will be invisible for him.

Links
=====

Task-2510267
See odoo/pull/71599
See odoo/enterprise/pull/19296
See odoo/upgrade/pull/2600
2021-07-09 12:32:28 +00:00
std-odoo 2d359b909b [ADD] mail_group: add a new module to manage the mailing lists
Purpose
=======

The purpose of this new module is to manage the mailing lists. Now they
are no more <mail.channel> (will email_send set to True) but they have
their own model.

Specifications
==============

The mailing list are basically a public discussion that users can have
by email. They can respond to email, send new messages, etc... All the
members of the mailing list will receive the message by email.

Users can moderate the emails of the mailing list in the same way as
they did with the "email" mail channel.
- *accept*, will accept the emails and send it to the members of the
  mailing list
- *discard*, will drop the email without warning the author
- *reject*, will drop the email and send a notification email to the
  author
- *allow*, will accept the email and all other pending emails of the
  same author and create a whitelist for him
- *ban* will drop the email and all other pending emails of the same
  author and create a blacklist for him

Now a portal view is available (in /groups) and replace the old module
"Website Mail Channel" that was removed in the previous commit. In this
view, users can subscribe / unsubscribe to the mailing lists and some
links to this portal view are added in the footer of the emails of the
mailing list.

As before with mail channels, you can send guidelines to the members,
notify the moderators whose an action is required (in a CRON), send back
an email to the author of an email to say "Your message is waiting
moderation"...

Links
=====

Task-2510267
See odoo/odoo/pull/71599
See odoo/enterprise/pull/19296
See odoo/upgrade/pull/2600
2021-07-09 12:32:28 +00:00