Skip to content

Commit

Permalink
[MIG] mail_footer_notified_partner: Migration to 14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cvinh committed Mar 10, 2022
1 parent d42af52 commit 2932bb4
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 101 deletions.
1 change: 0 additions & 1 deletion mail_footer_notified_partner/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# © 2016 ACSONE SA/NV <https://acsone.eu>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import models
9 changes: 5 additions & 4 deletions mail_footer_notified_partner/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
This module adds the list of notified partners in the footer of
notification e-mails sent by Odoo.
""",
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
"installable": True,
"author": "ACSONE SA/NV,Open SOurce Integrators,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/social",
"category": "Mail",
"version": "12.0.1.0.0",
"category": "Discuss",
"version": "14.0.1.0.0",
"license": "AGPL-3",
"depends": ["mail"],
"data": ["views/mail_templates.xml"],
"installable": True,
}
3 changes: 0 additions & 3 deletions mail_footer_notified_partner/models/__init__.py

This file was deleted.

49 changes: 0 additions & 49 deletions mail_footer_notified_partner/models/mail_followers.py

This file was deleted.

2 changes: 2 additions & 0 deletions mail_footer_notified_partner/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
* Jonathan Nemry <jonathan.nemry@acsone.eu>
* Simone Rubino <simone.rubino@agilebg.com>
* Daniel Reis <dreis@opensourceintegrators.com>
* Cyril Vinh-Tung <cyril@invitu.com>
44 changes: 0 additions & 44 deletions mail_footer_notified_partner/tests/test_mail_notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,6 @@


class TestMailNotification(common.TransactionCase):
def setUp(self):
super().setUp()
self.sender = self.env["res.partner"].create(
{
"name": "Test sender",
"email": "sender@example.com",
}
)
self.recipient = self.env["res.partner"].create(
{
"name": "Test recipient",
"email": "recipient@example.com",
}
)
self.message = self.env["mail.message"].create(
{
"subject": "Message test",
"author_id": self.sender.id,
"email_from": self.sender.email,
"message_type": "comment",
"model": "res.partner",
"res_id": self.recipient.id,
"partner_ids": [(4, self.recipient.id)],
"body": "<p>This is a test message</p>",
}
)

self.record = self.recipient

self.rdata = [
{
"type": "customer",
"id": self.recipient.id,
"groups": [None],
"active": True,
"share": True,
"notif": "email",
}
]
self.force_send = True
self.send_after_commit = True
self.model_description = False
self.mail_auto_delete = True

def test_get_signature_footer(self):
rep = self.recipient._notify(
self.message,
Expand Down
29 changes: 29 additions & 0 deletions mail_footer_notified_partner/views/mail_templates.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<odoo>
<data>

<template
id="message_notification_email"
inherit_id="mail.message_notification_email"
>
<xpath expr="//div[@t-if='signature']" position="before">
<div><p>
Also notified:
<span t-field="record.message_partner_ids" />
</p></div>
</xpath>
</template>

<template
id="message_notification_light"
inherit_id="mail.mail_notification_light"
>
<xpath expr="//t[@t-raw='message.body']" position="after">
<div><p>
Also notified:
<span t-field="record.message_partner_ids" />
</p></div>
</xpath>
</template>

</data>
</odoo>
6 changes: 6 additions & 0 deletions setup/mail_footer_notified_partner/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)

0 comments on commit 2932bb4

Please sign in to comment.