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

Fix server_environment module imports #93

Closed
wants to merge 1 commit into from

Conversation

dreispt
Copy link
Member

@dreispt dreispt commented Dec 10, 2014

Quick fix to make ./odoo.py help work without errors when the
server_environment_files modules does not exist.
Fixes #89.

Quick fix to make `./odoo.py help` work without errors when the
server_environment_files modules does not exist.
Fixes OCA#89.
@lepistone
Copy link
Member

would get_module_resource be useful here?

@dreispt
Copy link
Member Author

dreispt commented Dec 10, 2014

Build fails when trying to run tests for server_environment.
I'm clueless on how this is supposed to work.
At least I have Odoo commands working in my local environment.

@dreispt
Copy link
Member Author

dreispt commented Jan 5, 2015

@nbessi Do you think you could spare a few minutes to have a look at this?

@nbessi
Copy link

nbessi commented Jan 6, 2015

@dreispt it may come form the fact that you removed the dependence on server_environment_files. So there is nothing that prevent server_environnement to be loaded before server_environnement_files.

As far as I can see the setup still seems to be ok.

- ln -s server_environment_files_sample ./server_environment_files

Regards

Nicolas

@dreispt
Copy link
Member Author

dreispt commented Jan 6, 2015

@nbessi Thanks for the pointers. I tried that, and when I try ./odoo.py help now I get:

Traceback (most recent call last):
  File "./odoo.py", line 160, in <module>
    main()
  File "./odoo.py", line 157, in main
    openerp.cli.main()
  File "/home/dr/work/odoo/openerp/cli/__init__.py", line 60, in main
    __import__(m)
  File "/home/dr/work/odoo/openerp/modules/module.py", line 77, in load_module
    mod = imp.load_module('openerp.addons.' + module_part, f, path, descr)
  File "/home/dr/work/oca/server-tools/server_environment/__init__.py", line 21, in <module>
    from .serv_config import serv_config, setboolean
  File "/home/dr/work/oca/server-tools/server_environment/serv_config.py", line 41, in <module>
    "The parameter 'running_env' has not be set neither in base config "
Exception: The parameter 'running_env' has not be set neither in base config file option -c or in openerprc.
We strongly recommend against using the rc file but instead use an explicit config file with this content:
[options]
running_env = dev

_boolean_states = {
'1': True, 'yes': True, 'true': True, 'on': True,
'0': False, 'no': False, 'false': False, 'off': False}

Copy link

Choose a reason for hiding this comment

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

@dreispt We have to add a way to check if module is installed here.
There is not need to raise an exception if module is not installed.

By default we wanted to ensure that setup is correct if module was installed and OpenERP should not boot if it is the case.

An option is to move the check later but it is more error prone.

@hbrunn
Copy link
Member

hbrunn commented Feb 2, 2015

Can't you move all of that to server.config._register_hook? This fail fail early enough if there is no configuration, but won't interfere if the module is not installed

@dreispt
Copy link
Member Author

dreispt commented Feb 2, 2015

@hbrunn it causes errors in v8 even if the module is not installed - it's enough to be in the addons path.. Just try ./odoo.py help and you will get a traceback.

@hbrunn
Copy link
Member

hbrunn commented Feb 2, 2015

Yes, that's why I propose to move that code to _register_hook

@max3903 max3903 removed the 8.0 label Feb 17, 2015
@StefanRijnhart
Copy link
Member

+1 for putting this in _register_hook if possible.

@dreispt
Copy link
Member Author

dreispt commented Feb 27, 2015

Maybe the authors can provide a better fix and we close this?

@max3903 max3903 added this to the 8.0 milestone Mar 8, 2015
@dreispt dreispt closed this Nov 18, 2015
StefanRijnhart pushed a commit to StefanRijnhart/server-tools that referenced this pull request Feb 26, 2017
[IMP] monkey patch lxml's html cleaner
petrus-v pushed a commit to foodles-tech/server-tools that referenced this pull request Mar 9, 2023
Signed-off-by gurneyalex
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.

7 participants