Skip to content

Commit

Permalink
[OU-FIX] mail: set outgoing emails
Browse files Browse the repository at this point in the history
  • Loading branch information
MiquelRForgeFlow committed Feb 21, 2025
1 parent 7b94bad commit b638006
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
14 changes: 14 additions & 0 deletions openupgrade_scripts/scripts/mail/17.0.1.15/post-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,19 @@ def _mail_template_convert_report_template_m2o_to_m2m(env):
)


def _fill_mail_message_outgoing(env):
# set outgoing messages
openupgrade.logged_query(
env.cr,
"""
UPDATE mail_message
SET message_type = 'email_outgoing'
WHERE message_type = 'email'
AND message_id like '%-openerp-' || res_id || '-' || model || '@%'
""",
)


def _mail_activity_plan_template(env):
"""If the OCA mail_activity_plan module was installed, we create the
mail.activity.plan.template records.
Expand Down Expand Up @@ -140,4 +153,5 @@ def migrate(env, version):
_fill_res_company_alias_domain_id(env)
_mail_alias_fill_alias_full_name(env)
_mail_template_convert_report_template_m2o_to_m2m(env)
_fill_mail_message_outgoing(env)
_mail_activity_plan_template(env)
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ mail / mail.shortcode / message_ids (many2one) : DEL re
# NOTHING TO DO: following commit https://github.com/odoo/odoo/pull/138938/commits/94b71f74ba20733110c123e1c02df9a384fe9d74

mail / mail.message / message_type (selection) : selection_keys is now '['auto_comment', 'comment', 'email', 'email_outgoing', 'notification', 'user_notification']' ('['comment', 'email', 'notification', 'user_notification']')
# NOTHING TO DO: well when odoo backport https://github.com/odoo/odoo/pull/149576 in 15, nothing to do either because there is no way to detect and fill for 'auto_common' and 'email_outgoing'
# NOTHING TO DO (auto_comment): well when odoo backport https://github.com/odoo/odoo/pull/149576 in 15, nothing to do because there is no way to detect and fill for 'auto_common'
# DONE (email_outgoing): post-migration: set 'email_outgoing' emails using message_id

mail / mail.message / pinned_at (datetime) : NEW
# NOTHING TO DO: new feature to pin message
Expand Down

0 comments on commit b638006

Please sign in to comment.