[FIX] util.move_model: add version check for email.template#398
[FIX] util.move_model: add version check for email.template#398MrRose765 wants to merge 1 commit intoodoo:masterfrom
Conversation
src/util/modules.py
Outdated
| if version_gte("9.0"): | ||
| update_imd("mail.template", path="model") | ||
| else: | ||
| update_imd("email.template", path="model") |
There was a problem hiding this comment.
The rename happens in 8.saas~6.1 (weird old versioning scheme). Thus when Odoo 9.0 is running it can still encounter it.
https://github.com/odoo/upgrade/blob/9d12694ed46d478492ad43611b284c754ae69ce6/migrations/mail/8.saas~6.1.0/pre-adapt-models.py#L5
| if version_gte("9.0"): | |
| update_imd("mail.template", path="model") | |
| else: | |
| update_imd("email.template", path="model") | |
| update_imd("mail.template" if version_gte("10.0") else "email.template", path="model") |
There was a problem hiding this comment.
In that case, wouldn't it be a problem for the upgrade scripts that call move_model in 9.* ? (In other words, after the rename but before 10.0)
There was a problem hiding this comment.
There is no perfect solution. When Odoo 9 is running both models could appear --before or after the rename. We could do as well:
if not version_gte("10.0"):
update_imd("mail.template", path="model") # renamed in 8.saas~6.1
update_imd("email.template", path="model")This could cause issues if email.template was used in a DB in 8.0, but we get every few such upgrades nowadays, and they need other specific fixes anyway.
In [this](odoo/upgrade#4570 (comment)) PR, the [email_template update line](https://github.com/odoo/upgrade-util/blob/f97b7a28ef62fe4a7b0417854a904d132adc9882/src/util/modules.py#L1271) was preventing people from creating an `email.template` custom model even though it is not used in standard since version 8. Related issues : - [PR-specific](odoo/upgrade-specific#20818) - [OPW-6055415](https://www.odoo.com/odoo/project/70/tasks/6055415)
652d65a to
f7fa7cd
Compare
|
|
|
upgradeci retry with always only account crm im_chat in 9.0 master |

In this PR, the email_template update line was preventing people from creating an
email.templatecustom model even though it is not used in standard since version 8.Related issues :