diff --git a/mail_quoted_reply/models/mail_message.py b/mail_quoted_reply/models/mail_message.py index 242a414..38cc520 100644 --- a/mail_quoted_reply/models/mail_message.py +++ b/mail_quoted_reply/models/mail_message.py @@ -43,6 +43,6 @@ class MailMessage(models.Model): "is_quoted_reply": True, "default_notify": True, "force_email": True, - "default_partner_ids": [(6, 0, self.partner_ids.ids)], + "default_partner_ids": self.partner_ids.ids, } return action diff --git a/mail_quoted_reply/tests/test_reply.py b/mail_quoted_reply/tests/test_reply.py index 392e2fa..84ae0c9 100644 --- a/mail_quoted_reply/tests/test_reply.py +++ b/mail_quoted_reply/tests/test_reply.py @@ -13,7 +13,11 @@ class TestMessageReply(TransactionCase): partner.message_ids.filtered(lambda r: r.message_type != "notification") ) # pylint: disable=C8107 - message = partner.message_post(body="demo message", message_type="email") + message = partner.message_post( + body="demo message", + message_type="email", + partner_ids=self.env.ref("base.partner_demo").ids, + ) partner.refresh() self.assertIn( message, @@ -28,6 +32,8 @@ class TestMessageReply(TransactionCase): wizard = ( self.env[action["res_model"]].with_context(**action["context"]).create({}) ) + self.assertTrue(wizard.partner_ids) + self.assertEqual(message.partner_ids, wizard.partner_ids) # the onchange in the composer isn't triggered in tests, so we check for the # correct quote in the context email_quote = re.search("

.*?

", wizard._context["quote_body"]).group()