-
-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IMP] rename_models: add condition to check version and existence of ir_property table #395
base: master
Are you sure you want to change the base?
[IMP] rename_models: add condition to check version and existence of ir_property table #395
Conversation
…ir_property table
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to handle the renaming for 18+, changing model inside the JSON field.
(old,), | ||
) | ||
field_ids = [x[0] for x in cr.fetchall()] | ||
logged_query( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should go outside the if
.
), | ||
) | ||
if field_ids: | ||
if version_info[0] < 18 and table_exists(cr, "ir_property"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would be the reason to check if ir_property exists as a table?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just denying the case if the ir_property
table exists and the version is >= 18.0. because in fact if you use a database from 17.0 or earlier to migrate data to version >= 18.0, the ir_property
table still exists and is just no longer used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed that even in version 18 no operations should be performed in the table even if it exists! I would say checking the version is enough because we can rely on the table existing in earlier versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, maybe it's redundant. i will update it in next patch
model
ir.property
was removed in commit odoo/odoo@de302c2 in version18.0
so if new databases is initialized from 18.0 onwards will not haveir_property
table then there will be an error exception thatrelation ir_property does not exist
when using therename_models
function