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

[17.0][IMP] mail_notification_custom_subject: Make the subject_template field translatable #1524

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class MailMessageCustomSubject(models.Model):
)
subject_template = fields.Char(
required=True,
translate=True,
help="Subject (placeholders may be used here)",
)
position = fields.Selection(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,27 @@
# Copyright 2022 Tecnativa - Víctor Martínez
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
# pylint: disable=C8107
from odoo.tests import common
from odoo.tests import new_test_user
from odoo.tools import mute_logger

from odoo.addons.base.tests.common import BaseCommon

class TestMailNotificationCustomSubject(common.TransactionCase):

class TestMailNotificationCustomSubject(BaseCommon):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.partner_1, cls.partner_2 = (
cls.env["res.partner"]
.with_context(tracking_disable=True)
.create(
[
{"name": "Test partner 1", "email": "[email protected]"},
{"name": "Test partner 2", "email": "[email protected]"},
]
)
cls.partner_1, cls.partner_2 = cls.env["res.partner"].create(
[
{"name": "Test partner 1", "email": "[email protected]"},
{"name": "Test partner 2", "email": "[email protected]"},
]
)
cls.admin = common.new_test_user(cls.env, "boss", "base.group_system")
cls.admin = new_test_user(cls.env, "boss", "base.group_system")

def setUp(self):
super().setUp()
self.uid = common.new_test_user(self.env, "worker")
self.uid = new_test_user(self.env, "worker")

def test_email_subject_template_overrides(self):
with self.with_user("boss"):
Expand Down
Loading