Skip to content

Commit

Permalink
[FIX] mail_gateway: dummy compatibility with m2m fields
Browse files Browse the repository at this point in the history
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
  • Loading branch information
chienandalu committed Nov 7, 2024
1 parent 34d02e4 commit 19d10c0
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion mail_gateway/wizards/mail_compose_gateway_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class MailComposeGatewayMessage(models.TransientModel):
"attachment_id",
"Attachments",
)

partner_ids = fields.Many2many(
"res.partner",
"mail_compose_gateway_message_res_partner_rel",
Expand All @@ -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()
Expand Down

0 comments on commit 19d10c0

Please sign in to comment.