-
-
Notifications
You must be signed in to change notification settings - Fork 664
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
[15.0][OU-IMP] project: merge project_status #4414
base: 15.0
Are you sure you want to change the base?
Conversation
# We need to delete old project_status views | ||
openupgrade.logged_query( | ||
env.cr, | ||
"DELETE FROM ir_ui_view WHERE model = 'project.project';" | ||
) |
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 part may be a bit overkill. But I need to delete project_status
views because there is references on old project.status model in it, and this causes the database to fail showing project views.
But views where renamed during updade of the base module, so I didn't find a way to distinguish between views that are part of existing project module and views coming from project_status and that were renamed.
I tried to remove old views by xmlids but this does not work. I think that this is because some xmlids ends up being the same after the renaming (e.g. project_status.edit_project
and project.edit_project
).
By using this, I force the update of project module to recreate views of the project.project model.
Any better way of doing it is welcome.
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.
Indeed this is not OK. Regular update process (the second pass without OpenUpgrade) must remove them being noupdate="0".
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 tried not to delete project.project
views, and perform a regular update after migration in 15.0.
I got the following logs:
2024-04-23 08:39:02,435 7 INFO brupower_upgrade odoo.addons.base.models.ir_module: ALLOW access to module.button_immediate_upgrade on ['Projet'] to user __system__ #1 via n/a
2024-04-23 08:39:02,436 7 INFO brupower_upgrade odoo.addons.base.models.ir_module: ALLOW access to module.button_upgrade on ['Projet'] to user __system__ #1 via n/a
2024-04-23 08:39:02,436 7 INFO brupower_upgrade odoo.addons.base.models.ir_module: ALLOW access to module.update_list on ['Projet'] to user __system__ #1 via n/a
2024-04-23 08:39:09,805 7 INFO brupower_upgrade odoo.addons.base.models.ir_module: ALLOW access to module.button_install on [] to user __system__ #1 via n/a
...
2024-04-23 08:39:19,078 7 INFO brupower_upgrade odoo.modules.loading: loading project/views/project_views.xml
2024-04-23 08:39:19,253 7 WARNING brupower_upgrade odoo.addons.openupgrade_framework.odoo_patch.odoo.addons.base.models.ir_ui_view: Can't render custom view project.project_view_kanban for model project.project. Assuming you are migrating
between major versions of Odoo. Please review the view contents manually after the migration.
Error: Element '<kanban class="o_kanban_mobile">' cannot be located in parent view
2024-04-23 08:39:19,286 7 WARNING brupower_upgrade odoo.addons.openupgrade_framework.odoo_patch.odoo.addons.base.models.ir_ui_view: Can't render custom view project.project_view_kanban for model project.project. Assuming you are migrating
between major versions of Odoo. Please review the view contents manually after the migration.
Error: Element '<kanban class="o_kanban_mobile">' cannot be located in parent view
2024-04-23 08:39:19,325 7 INFO brupower_upgrade odoo.models.unlink: User #1 deleted ir.actions.act_window.view records with IDs: [336, 337]
2024-04-23 08:39:19,593 7 WARNING brupower_upgrade odoo.addons.openupgrade_framework.odoo_patch.odoo.addons.base.models.ir_ui_view: Can't render custom view project.project_view_kanban for model project.project. Assuming you are migrating
between major versions of Odoo. Please review the view contents manually after the migration.
Error: Element '<kanban class="o_kanban_mobile">' cannot be located in parent view
2024-04-23 08:39:19,598 7 INFO brupower_upgrade odoo.modules.loading: loading project/views/res_partner_views.xml
...
So it seams that I need to delete some views, but may be not all.
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.
That's not a regular update, as openupgrade_framework
is still around. Regular update will remove them.
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.
Ho, yes indeed.
I've tested to deactivate views instead of deleting it, and it works also.
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.
To perform a regular update after this migration in 15.0, I need to add a step to my migration process. Without deactivating views, if I go directly from a upgrade in 15.0 with openupgrade to an upgrade in 16.0 with openupgrade then upgrade in 16.0 with openupgrade fails.
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.
Well, that shouldn't happen. It will emit the same warnings, but no crash.
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 fixed it by just removing views that were overridden in the project_status
module. And it works well.
Some standard views of project
module were deleted in pre-migration
script and then created fresh new by the update.
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.
@pedrobaeza What do you think about the fix I proposed? It has been tested on a database for a real migration.
294dcea
to
8877eda
Compare
f15c4de
to
f720786
Compare
f720786
to
c674c7e
Compare
}, | ||
) | ||
# Delete project_status views | ||
xmlids_views = [ |
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 still don't see this as correct. Views are not a blocker for migration processes, and more deleting the whole inheritance chain. Please remove this part.
Merge
project_status
intoproject
module. (OCA/project#1269)