Skip to content
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

[6.0] Using openupgradelib - ImportError: No module named openerp #373

Closed
sebalix opened this issue Sep 25, 2015 · 6 comments
Closed

[6.0] Using openupgradelib - ImportError: No module named openerp #373

sebalix opened this issue Sep 25, 2015 · 6 comments

Comments

@sebalix
Copy link

sebalix commented Sep 25, 2015

I think that the integration of openupgradelib in the 6.0 branch does not work (5f48ad1), but maybe it is a bug related to openupgradelib as the openerp Python package does not exist yet in 6.0.
Here is the traceback when I launch a 6.0 migration:

[2015-09-25 12:05:11,154][?] INFO:server:OpenERP version - 6.0.4
[2015-09-25 12:05:11,154][?] INFO:server:addons_path - /home/odoo/openupgrade/server/bin/addons,/home/odoo/openupgrade/server/addons,/home/odoo/openupgrade/addons
[2015-09-25 12:05:11,154][?] INFO:server:database hostname - localhost
[2015-09-25 12:05:11,154][?] INFO:server:database port - 5432
[2015-09-25 12:05:11,154][?] INFO:server:database user - odoo
[2015-09-25 12:05:11,154][?] INFO:server:initialising distributed objects services
Traceback (most recent call last):
  File "/home/odoo/openupgrade/server/bin/openerp-server.py", line 94, in <module>
    import report
  File "/home/odoo/openupgrade/server/bin/report/__init__.py", line 22, in <module>
    import interface
  File "/home/odoo/openupgrade/server/bin/report/interface.py", line 30, in <module>
    import addons
  File "/home/odoo/openupgrade/server/bin/addons/__init__.py", line 53, in <module>
    from openupgrade import openupgrade
  File "/home/odoo/openupgrade/server/bin/openupgrade/openupgrade.py", line 33, in <module>
    _modules = __import__(_new_name, globals(), locals(), ['*'])
  File "/usr/local/lib/python2.7/dist-packages/openupgradelib/openupgrade.py", line 26, in <module>
    from openerp import release, tools, SUPERUSER_ID
ImportError: No module named openerp

Version of openupgradelib: 1.1.0

If I checkout a previous commit (e.g. 3962895), all is working fine.

@pedrobaeza
Copy link
Member

Curious, I'll do it some weeks ago with my PR branch and worked. Let me check again.

@sebalix
Copy link
Author

sebalix commented Sep 25, 2015

The use of openupgradelib has been merged 3 days ago in the 6.0 branch, it can explain why you had no problem?

@pedrobaeza
Copy link
Member

Yeah, but I "beta-tested" it merging also the PR in my OpenUpgrade branch. Let me check.

@StefanRijnhart
Copy link
Member

Sorry, I did not bother to test this version either. But in 6.0 you could indeed not import openerp. Instead, there was the bin directory containing release and tools. SUPERUSER_ID wasn't there at all.
See http://bazaar.launchpad.net/~openupgrade-committers/openupgrade-server/6.0/view/head:/bin/openupgrade/openupgrade.py#L26. We need to try/catch both imports.

@pedrobaeza
Copy link
Member

I tested from 6.1 version, that's why it worked. But I'll do a PR afterwards for solving this in a moment.

@pedrobaeza
Copy link
Member

OK, done in OCA/openupgradelib#21

GuillemCForgeFlow pushed a commit to ForgeFlow/OpenUpgrade that referenced this issue Oct 10, 2024
…ters-probing

[IMP] disable_invalid_filters: log filter probes
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

No branches or pull requests

3 participants