Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2024 Le Filament <https://le-filament.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openupgradelib import openupgrade


def update_product_template_mail_model(env):
"""
Mail template model has changed from product.template to account.move in v13
"""
account_move_model = env["ir.model"].search([("model", "=", "account.move")])
mail_template_ids = env["product.template"].search(
[("email_template_id", "!=", False)]
).mapped("email_template_id")
mail_template_ids.filtered(lambda t: t.model == 'product.template').write(
{"model_id": account_move_model.id}
)


@openupgrade.migrate()
def migrate(env, version):
update_product_template_mail_model(env)
2 changes: 1 addition & 1 deletion odoo/openupgrade/doc/source/modules120-130.rst
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ missing in the new release are marked with |del|.
+----------------------------------------------+-------------------------------------------------+
|product | Done |
+----------------------------------------------+-------------------------------------------------+
|product_email_template | |
|product_email_template | Done |
+----------------------------------------------+-------------------------------------------------+
|product_expiry | Nothing to do |
+----------------------------------------------+-------------------------------------------------+
Expand Down
Loading