Skip to content

15.0 mig openupgrade framework#2967

Merged
pedrobaeza merged 33 commits intoOCA:15.0from
legalsylvain:15.0-mig-openupgrade_framework
May 18, 2022
Merged

15.0 mig openupgrade framework#2967
pedrobaeza merged 33 commits intoOCA:15.0from
legalsylvain:15.0-mig-openupgrade_framework

Conversation

@legalsylvain
Copy link
Contributor

@legalsylvain legalsylvain commented Nov 15, 2021

Hi all.

I just executed meld on odoo subfolder to check the differences, to guess if the openupgrade_framework was requiring changes.
At first sight : very fiew changes.

some changes related to base framework (for information)

Some changes related to OpenUpgrade framework

  • lot of changes in _check_xml. Specially odoo/odoo@46f1912. Nothing to do in my opinion

  • lot of changes in _post_process_view. Here odoo/odoo@331b547. Nothing to do in my opinion

  • handle_view_error has been splitted in two functions here odoo/odoo@9ae8c1a. TODO

@legalsylvain legalsylvain mentioned this pull request Nov 15, 2021
9 tasks
@legalsylvain legalsylvain force-pushed the 15.0-mig-openupgrade_framework branch from 343a106 to 8f33a33 Compare November 15, 2021 22:08
@oerp-odoo
Copy link

Whats the status of this PR? Is it possible to get it merged soon?

@legalsylvain legalsylvain added this to the 15.0 milestone Mar 3, 2022
@sutidor
Copy link

sutidor commented Apr 6, 2022

Nice. Looking forward to see this done.

@legalsylvain
Copy link
Contributor Author

Hi. This PR is WIP.
No time immediately. Help welcome.

regards.

"recommended to run the Odoo with --load=openupgrade_framework "
"when migrating your database."
)
openupgrade.rename_xmlids(cr, [("mail.icp_mail_catchall_alias", "base.icp_mail_catchall_alias")])
Copy link
Contributor

@royle-vietnam royle-vietnam Apr 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line too long and correct indentation

Suggested change
openupgrade.rename_xmlids(cr, [("mail.icp_mail_catchall_alias", "base.icp_mail_catchall_alias")])
openupgrade.rename_xmlids(
cr,
[
("mail.icp_mail_catchall_alias", "base.icp_mail_catchall_alias"),
("mail.icp_mail_bounce_alias", "base.icp_mail_bounce_alias"),
],
)

Comment on lines +49 to +53
def _postprocess_view(self, node, model, validate=True, editable=True):
"""Don't validate views, _raise_view_error is mutted"""
return View._postprocess_view._original_method(
self, node, model, validate=False, editable=editable
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@legalsylvain correct number of args

Suggested change
def _postprocess_view(self, node, model, validate=True, editable=True):
"""Don't validate views, _raise_view_error is mutted"""
return View._postprocess_view._original_method(
self, node, model, validate=False, editable=editable
)
def _postprocess_view(self, node, model, editable=True):
"""Don't validate views, _raise_view_error is mutted"""
return View._postprocess_view._original_method(
self, node, model, editable=editable
)

@royle-vietnam
Copy link
Contributor

@legalsylvain Looking forward to see this done. Could you make a todo list to follow / help?

@legalsylvain
Copy link
Contributor Author

@royleviindoo.
Thanks for the ping.

I haven't worked on this RP for a while, so I'm not sure!
I'll plan to work on it again, the week of May 9, and let you know what it is.

Have a good weekend.

@jcdrubay
Copy link
Contributor

@royleviindoo FYI, I am currently working on this fork https://github.com/jcdrubay/OpenUpgrade/tree/15.0-add-xml-ids-moved-from-mail-to-base

@royle-vietnam
Copy link
Contributor

@royleviindoo FYI, I am currently working on this fork https://github.com/jcdrubay/OpenUpgrade/tree/15.0-add-xml-ids-moved-from-mail-to-base

Hi @jcdrubay , I looked at your repository, but didn't see any difference
FYI, Our company is currently working on repo https://github.com/Viindoo/OpenUpgrade/blob/15.0/docsource/modules140-150.rst

@legalsylvain
Copy link
Contributor Author

@royleviindoo : you can review the diff hère :

legalsylvain#4

@legalsylvain
Copy link
Contributor Author

Hi @jcdrubay. CI is now green. Thanks !

just tested a migration from 14 to 15 with that up-to-date branch (account + web_responsive installed).

  • migration passed
  • V15 is available

Some remaining points :

  1. I have a warning
2022-05-13 13:33:52,958 1 WARNING test__openupgrade__14__15_a py.warnings: /usr/lib/python3.9/contextlib.py:117: DeprecationWarning: Since Odoo 15.0, Environment.manage() is useless.

  File "/odoo_env/src/openupgrade/openupgrade_framework/odoo_patch/odoo/modules/migration.py", line 17, in migrate_module
    MigrationManager.migrate_module._original_method(self, pkg, stage)
  File "/odoo_env/src/odoo/odoo/modules/migration.py", line 180, in migrate_module
    migrate(self.cr, installed_version)
  File "/usr/local/lib/python3.9/dist-packages/openupgradelib/openupgrade.py", line 1992, in wrapped_function
    contextmanagers.enter_context(api.Environment.manage())

Something should be fixed in openupgradelib project.

  1. I have a lot of logs, related to renaming :
    2022-05-13 13:33:44,614 1 INFO test__openupgrade__14__15_a OpenUpgrade: XMLID l10n_ec.state_ec_1 not found when renaming to base.state_ec_01

Fixed here : aebb0d2

  1. Did you planned to finish base migration ? it seems there are some points present in the analysis files that are not handled ? (just a question)

@legalsylvain legalsylvain force-pushed the 15.0-mig-openupgrade_framework branch from aebb0d2 to 7d5849b Compare May 13, 2022 14:09
@legalsylvain legalsylvain marked this pull request as ready for review May 13, 2022 14:11
@jcdrubay
Copy link
Contributor

I would be happy to continue the work on base module.
It would help me a lot if you could pinpoint some of the remaining tasks to do as I did not realize something was missing.

legalsylvain and others added 12 commits May 17, 2022 10:13
If we don't include it, /jsonrpc route doesn't work.
If you have a module in previous versions that adds data on a model,
and such model is not loaded in the registry in current version because
the module is absent in it, you can't uninstall such module, getting
this error:

  File "odoo/odoo/addons/base/models/ir_model.py", line 1945, in _module_data_uninstall
    delete(self.env[model].browse(item[1] for item in items))
  File "odoo/odoo/api.py", line 463, in __getitem__
    return self.registry[model_name]._browse(self, (), ())
  File "odoo/odoo/modules/registry.py", line 177, in __getitem__
    return self.models[model_name]
KeyError: 'model'

With this patch, data cleanup of such model is skipped and there's no crash.
…ore ; add links to the new OpenUpgrade website
StefanRijnhart and others added 20 commits May 17, 2022 10:13
If corresponding field is None, we need to avoid the "AttributeError: 'NoneType' object has no attribute error.
Co-authored-by: Jean-Charles Drubay <jcdrubay@users.noreply.github.com>
…e useless after the input argument validate has been removed
@MiquelRForgeFlow MiquelRForgeFlow force-pushed the 15.0-mig-openupgrade_framework branch 3 times, most recently from bb02612 to e4c3934 Compare May 17, 2022 08:48
@MiquelRForgeFlow MiquelRForgeFlow force-pushed the 15.0-mig-openupgrade_framework branch from e4c3934 to 130d038 Compare May 17, 2022 08:50
Copy link
Contributor

@MiquelRForgeFlow MiquelRForgeFlow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pedrobaeza pedrobaeza merged commit c5be4f4 into OCA:15.0 May 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants