mirror of https://github.com/OCA/social.git
[17][MIG] mail_optional_autofollow: Migration to 17.0
parent
750cb03335
commit
55fc7d9eed
|
@ -8,7 +8,7 @@
|
||||||
"author": "ACSONE SA/NV," "Odoo Community Association (OCA)",
|
"author": "ACSONE SA/NV," "Odoo Community Association (OCA)",
|
||||||
"website": "https://github.com/OCA/social",
|
"website": "https://github.com/OCA/social",
|
||||||
"category": "Social Network",
|
"category": "Social Network",
|
||||||
"version": "16.0.1.0.0",
|
"version": "17.0.1.0.0",
|
||||||
"license": "AGPL-3",
|
"license": "AGPL-3",
|
||||||
"depends": ["mail"],
|
"depends": ["mail"],
|
||||||
"data": ["wizard/mail_compose_message_view.xml"],
|
"data": ["wizard/mail_compose_message_view.xml"],
|
||||||
|
|
|
@ -4,8 +4,10 @@
|
||||||
#
|
#
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Odoo Server 16.0\n"
|
"Project-Id-Version: Odoo Server 17.0+e\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2024-05-06 15:24+0000\n"
|
||||||
|
"PO-Revision-Date: 2024-05-06 15:24+0000\n"
|
||||||
"Last-Translator: \n"
|
"Last-Translator: \n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
|
@ -19,13 +21,11 @@ msgid "Email composition wizard"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: mail_optional_autofollow
|
#. module: mail_optional_autofollow
|
||||||
#: model:ir.model.fields,field_description:mail_optional_autofollow.field_account_invoice_send__autofollow_recipients
|
|
||||||
#: model:ir.model.fields,field_description:mail_optional_autofollow.field_mail_compose_message__autofollow_recipients
|
#: model:ir.model.fields,field_description:mail_optional_autofollow.field_mail_compose_message__autofollow_recipients
|
||||||
msgid "Make recipients followers"
|
msgid "Make recipients followers"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#. module: mail_optional_autofollow
|
#. module: mail_optional_autofollow
|
||||||
#: model:ir.model.fields,help:mail_optional_autofollow.field_account_invoice_send__autofollow_recipients
|
|
||||||
#: model:ir.model.fields,help:mail_optional_autofollow.field_mail_compose_message__autofollow_recipients
|
#: model:ir.model.fields,help:mail_optional_autofollow.field_mail_compose_message__autofollow_recipients
|
||||||
msgid ""
|
msgid ""
|
||||||
"if checked, the additional recipients will be added as followers on "
|
"if checked, the additional recipients will be added as followers on "
|
||||||
|
|
|
@ -6,7 +6,7 @@ from odoo.tests import common
|
||||||
|
|
||||||
class TestAttachExistingAttachment(common.TransactionCase):
|
class TestAttachExistingAttachment(common.TransactionCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestAttachExistingAttachment, self).setUp()
|
super().setUp()
|
||||||
self.partner_obj = self.env["res.partner"]
|
self.partner_obj = self.env["res.partner"]
|
||||||
self.partner_01 = self.env.ref("base.res_partner_10")
|
self.partner_01 = self.env.ref("base.res_partner_10")
|
||||||
self.partner_02 = self.env.ref("base.res_partner_address_17")
|
self.partner_02 = self.env.ref("base.res_partner_address_17")
|
||||||
|
@ -16,15 +16,15 @@ class TestAttachExistingAttachment(common.TransactionCase):
|
||||||
ctx.update(
|
ctx.update(
|
||||||
{
|
{
|
||||||
"default_model": "res.partner",
|
"default_model": "res.partner",
|
||||||
"default_res_id": self.partner_01.id,
|
"default_res_ids": self.partner_01.ids,
|
||||||
"default_composition_mode": "comment",
|
"default_composition_mode": "comment",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
mail_compose = self.env["mail.compose.message"]
|
mail_compose = self.env["mail.compose.message"]
|
||||||
values = mail_compose.with_context(**ctx)._onchange_template_id(
|
values = {
|
||||||
False, "comment", "res.partner", self.partner_01.id
|
"partner_ids": [(4, self.partner_02.id)],
|
||||||
)["value"]
|
"composition_mode": "comment",
|
||||||
values["partner_ids"] = [(4, self.partner_02.id)]
|
}
|
||||||
compose_id = mail_compose.with_context(**ctx).create(values)
|
compose_id = mail_compose.with_context(**ctx).create(values)
|
||||||
compose_id.autofollow_recipients = False
|
compose_id.autofollow_recipients = False
|
||||||
compose_id.with_context(**ctx).action_send_mail()
|
compose_id.with_context(**ctx).action_send_mail()
|
||||||
|
|
|
@ -9,7 +9,7 @@ class MailComposeMessage(models.TransientModel):
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def default_get(self, fields_list):
|
def default_get(self, fields_list):
|
||||||
res = super(MailComposeMessage, self).default_get(fields_list)
|
res = super().default_get(fields_list)
|
||||||
res.setdefault(
|
res.setdefault(
|
||||||
"autofollow_recipients", self.env.context.get("mail_post_autofollow", False)
|
"autofollow_recipients", self.env.context.get("mail_post_autofollow", False)
|
||||||
)
|
)
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<xpath expr="//div[field[@name='partner_ids']]" position="after">
|
<xpath expr="//div[field[@name='partner_ids']]" position="after">
|
||||||
<field
|
<field
|
||||||
name="autofollow_recipients"
|
name="autofollow_recipients"
|
||||||
attrs="{'invisible': [('composition_mode', '=', 'mass_mail')]}"
|
invisible="composition_mode == 'mass_mail'"
|
||||||
/>
|
/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
|
|
Loading…
Reference in New Issue