Skip to content

Commit fc5b908

Browse files
committed
[FIX] util.move_model: modify email_template only if model column exists
In [move_model], we were always updating the `email.template` model, even if the model is replaced by `mail.template` since OpenERP 9.0. The problem is that it prevents users from creating a custom `email.template` model even if it is not used in standard since version 8.0. Related issue : - [PR-specific](odoo/upgrade-specific#20818) [move_model]: https://github.com/odoo/upgrade-util/blob/f97b7a28ef62fe4a7b0417854a904d132adc9882/src/util/modules.py#L1271
1 parent f97b7a2 commit fc5b908

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/util/modules.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,8 +1268,11 @@ def update_imd(data_model, path):
12681268
update_imd("ir.actions.act_window", path="res_model")
12691269
update_imd("ir.actions.server", path="model_id.model")
12701270
update_imd("ir.actions.report", path="model")
1271-
update_imd("email.template", path="model") # OpenERP <= 8.0
1272-
update_imd("mail.template", path="model")
1271+
if column_exists(cr, "email_template", "model"):
1272+
# OpenERP <= 8.0
1273+
update_imd("email.template", path="model")
1274+
else:
1275+
update_imd("mail.template", path="model")
12731276
if column_exists(cr, "ir_cron", "model"):
12741277
# < 10.saas~14
12751278
update_imd("ir.cron", path="model")

0 commit comments

Comments
 (0)