Files
odoo_source/addons/mail_group/data/mail_group_demo.xml
T
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

165 lines
10 KiB
XML

<odoo>
<data>
<!-- Group 1 -->
<record id="mail_group_1" model="mail.group">
<field name="name">My Company News</field>
<field name="alias_name">newsletter</field>
<field name="description">Receive news about "My Company"</field>
<field name="moderation" eval="True"/>
<field name="moderator_ids" eval="[(4, ref('base.user_admin'))]"/>
<field name="access_mode">groups</field>
<field name="access_group_id" ref="base.group_user"/>
</record>
<!-- Members of group 1 -->
<record id="mail_group_member_1" model="mail.group.member">
<field name="partner_id" ref="base.partner_admin"/>
<field name="email">admin@yourcompany.example.com</field>
<field name="mail_group_id" ref="mail_group_1"/>
</record>
<record id="mail_group_member_2" model="mail.group.member">
<field name="partner_id" ref="base.partner_demo"/>
<field name="email">mark.brown23@example.com</field>
<field name="mail_group_id" ref="mail_group_1"/>
</record>
<!-- Attachment of messages -->
<record id="ir_attachment_mail_group_message_1" model="ir.attachment">
<field name="datas">U3VwZXIgc2VjcmV0IGF0dGFjaG1lbnQ=</field>
<field name="name">attachment.txt</field>
</record>
<record id="ir_attachment_mail_group_message_2" model="ir.attachment">
<field name="datas">QnV0IEphdmFzY3JpcHQgc3Vja3M=</field>
<field name="name">attachment.txt</field>
</record>
<!-- Messages of group 1 -->
<record id="mail_group_message_1" model="mail.group.message">
<field name="subject">Important Announce</field>
<field name="body">This weekend, you should all come to our barbecue!</field>
<field name="email_from">mark.brown23@example.com</field>
<field name="author_id" ref="base.partner_demo"/>
<field name="moderation_status">accepted</field>
<field name="group_message_parent_id" eval="False"/>
<field name="mail_group_id" ref="mail_group_1"/>
<field name="attachment_ids" eval="[(4, ref('ir_attachment_mail_group_message_1'))]"/>
</record>
<record id="mail_group_message_1_1" model="mail.group.message">
<field name="subject">Re: Important Announce</field>
<field name="body">Will there be vegetarian food?</field>
<field name="email_from">admin@yourcompany.example.com</field>
<field name="author_id" ref="base.partner_admin"/>
<field name="moderation_status">accepted</field>
<field name="group_message_parent_id" ref="mail_group_message_1"/>
<field name="mail_group_id" ref="mail_group_1"/>
</record>
<record id="mail_group_message_1_1_1" model="mail.group.message">
<field name="subject">Re: Important Announce</field>
<field name="body">Yes of course, and for those who are allergic bring your own food</field>
<field name="email_from">mark.brown23@example.com</field>
<field name="author_id" ref="base.partner_demo"/>
<field name="moderation_status">accepted</field>
<field name="group_message_parent_id" ref="mail_group_message_1_1"/>
<field name="mail_group_id" ref="mail_group_1"/>
</record>
<record id="mail_group_message_1_2" model="mail.group.message">
<field name="subject">Re: Important Announce</field>
<field name="body">Can I come with my dog ?</field>
<field name="email_from">joel.willis63@example.com</field>
<field name="moderation_status">accepted</field>
<field name="group_message_parent_id" ref="mail_group_message_1"/>
<field name="mail_group_id" ref="mail_group_1"/>
</record>
<record id="mail_group_message_1_2_1" model="mail.group.message">
<field name="subject">Re: Important Announce</field>
<field name="body">No animals please.</field>
<field name="email_from">admin@yourcompany.example.com</field>
<field name="author_id" ref="base.partner_admin"/>
<field name="moderation_status">accepted</field>
<field name="group_message_parent_id" ref="mail_group_message_1_2"/>
<field name="mail_group_id" ref="mail_group_1"/>
</record>
<record id="mail_group_message_2" model="mail.group.message">
<field name="subject">Recruitment</field>
<field name="body">We are pleased to announce that we have hired 10 new people this month.</field>
<field name="email_from">admin@yourcompany.example.com</field>
<field name="author_id" ref="base.partner_admin"/>
<field name="moderation_status">accepted</field>
<field name="group_message_parent_id" eval="False"/>
<field name="mail_group_id" ref="mail_group_1"/>
</record>
<record id="mail_group_message_3" model="mail.group.message">
<field name="subject">Relocation</field>
<field name="body">We are moving our office to Brussels. Take back all your remaining stuff.</field>
<field name="email_from">admin@yourcompany.example.com</field>
<field name="author_id" ref="base.partner_admin"/>
<field name="moderation_status">accepted</field>
<field name="group_message_parent_id" eval="False"/>
<field name="mail_group_id" ref="mail_group_1"/>
</record>
<record id="mail_group_message_3_1" model="mail.group.message">
<field name="subject">Re: Relocation</field>
<field name="body">Is there a swimming pool in this new office?</field>
<field name="email_from">joel.willis63@example.com</field>
<field name="moderation_status">accepted</field>
<field name="group_message_parent_id" ref="mail_group_message_3"/>
<field name="mail_group_id" ref="mail_group_1"/>
</record>
<record id="mail_group_message_3_1_1" model="mail.group.message">
<field name="subject">Re: Relocation</field>
<field name="body">Of course!</field>
<field name="email_from">admin@yourcompany.example.com</field>
<field name="author_id" ref="base.partner_admin"/>
<field name="moderation_status">accepted</field>
<field name="group_message_parent_id" ref="mail_group_message_3_1"/>
<field name="mail_group_id" ref="mail_group_1"/>
</record>
<record id="mail_group_message_3_2" model="mail.group.message">
<field name="subject">Re: Relocation</field>
<field name="body">What is the deadline for taking back my stuff?</field>
<field name="email_from">mark.brown23@example.com</field>
<field name="author_id" ref="base.partner_demo"/>
<field name="moderation_status">accepted</field>
<field name="group_message_parent_id" ref="mail_group_message_3"/>
<field name="mail_group_id" ref="mail_group_1"/>
</record>
<record id="mail_group_message_3_2_1" model="mail.group.message">
<field name="subject">Re: Relocation</field>
<field name="body">In 4 weeks.</field>
<field name="email_from">admin@yourcompany.example.com</field>
<field name="author_id" ref="base.partner_admin"/>
<field name="moderation_status">pending_moderation</field>
<field name="group_message_parent_id" ref="mail_group_message_3_2"/>
<field name="mail_group_id" ref="mail_group_1"/>
</record>
<record id="mail_group_message_4" model="mail.group.message">
<field name="subject">I really like CSS &amp; HTML</field>
<field name="body">
&lt;p style=&quot;margin:0px; font-size:13px;&quot;&gt;Hi,&lt;/p&gt;&lt;br&gt; &lt;p style=&quot;margin:0px; font-size:13px;&quot;&gt; We &lt;u style=&quot;font-size:14px&quot;&gt;really&lt;/u&gt; like &lt;font style=&quot;color:rgb(57, 123, 33); font-weight:bolder&quot;&gt;colors&lt;/font&gt; and &lt;span style=&quot;font-weight:bolder&quot;&gt;&lt;font style=&quot;color:rgb(255, 0, 0)&quot;&gt;CSS&lt;/font&gt;&lt;/span&gt;. &lt;/p&gt; &lt;p style=&quot;margin:0px; font-size:13px;&quot;&gt;Do you know you can add &lt;/p&gt; &lt;a href=&quot;https://example.com&quot; target=&quot;_blank&quot; class=&quot;btn btn-primary flat btn-sm&quot;&gt;link in email&lt;/a&gt; ? &lt;ol&gt; &lt;li&gt;Also image&lt;/li&gt; &lt;li&gt;List&lt;/li&gt; &lt;li&gt;Any HTML code in the end...&lt;/li&gt; &lt;/ol&gt;
</field>
<field name="email_from">admin@yourcompany.example.com</field>
<field name="author_id" ref="base.partner_admin"/>
<field name="moderation_status">pending_moderation</field>
<field name="group_message_parent_id" eval="False"/>
<field name="mail_group_id" ref="mail_group_1"/>
<field name="attachment_ids" eval="[(4, ref('ir_attachment_mail_group_message_2'))]"/>
</record>
<!-- Group 2 -->
<record id="mail_group_2" model="mail.group">
<field name="name">Public Mailing List</field>
<field name="alias_name">public_group</field>
<field name="description">Get the patch notes of our amazing product.</field>
<field name="moderation" eval="True"/>
<field name="moderator_ids" eval="[(4, ref('base.user_admin'))]"/>
</record>
<!-- Message of Group 2 -->
<record id="mail_group_message_5" model="mail.group.message">
<field name="subject">Best patch ever</field>
<field name="body">In this patch, we have cleaned the CSS!</field>
<field name="email_from">mark.brown23@example.com</field>
<field name="author_id" ref="base.partner_demo"/>
<field name="moderation_status">accepted</field>
<field name="group_message_parent_id" eval="False"/>
<field name="mail_group_id" ref="mail_group_2"/>
</record>
</data>
</odoo>