From 19d10c012e59cd9e21c500055a7115636c53c41a Mon Sep 17 00:00:00 2001 From: David Date: Thu, 7 Nov 2024 12:21:17 +0100 Subject: [PATCH] [FIX] mail_gateway: dummy compatibility with m2m fields Other OCA modules extending the composer add m2m fields with fixed relations. To avoid a glue module we try for the moment to add those manually. TT51108 --- .../wizards/mail_compose_gateway_message.py | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/mail_gateway/wizards/mail_compose_gateway_message.py b/mail_gateway/wizards/mail_compose_gateway_message.py index 483a7598c24..f99d9405aab 100644 --- a/mail_gateway/wizards/mail_compose_gateway_message.py +++ b/mail_gateway/wizards/mail_compose_gateway_message.py @@ -28,7 +28,6 @@ class MailComposeGatewayMessage(models.TransientModel): "attachment_id", "Attachments", ) - partner_ids = fields.Many2many( "res.partner", "mail_compose_gateway_message_res_partner_rel", @@ -37,6 +36,30 @@ class MailComposeGatewayMessage(models.TransientModel): "Additional Contacts", domain=lambda r: r._partner_ids_domain(), ) + # Dummy compatibility with other OCA modules + # OCA/mail_attach_existing_attachment + object_attachment_ids = fields.Many2many( + comodel_name="ir.attachment", + relation="mail_compose_gateway_message_ir_attachments_object_rel", + column1="wizard_id", + column2="attachment_id", + string="Object Attachments", + ) + # OCA/mail_composer_cc_bcc + partner_cc_ids = fields.Many2many( + comodel_name="res.partner", + relation="mail_compose_message_res_partner_cc_rel", + column1="wizard_id", + column2="partner_id", + string="Cc", + ) + partner_bcc_ids = fields.Many2many( + comodel_name="res.partner", + relation="mail_compose_message_res_partner_bcc_rel", + column1="wizard_id", + column2="partner_id", + string="Bcc", + ) def get_mail_values(self, res_ids): self.ensure_one()