OCA / connector-jira

GNU Affero General Public License v3.0
20 stars 43 forks source link

Mandatory installation of JIRA to use multi_step_wizard #18

Closed jarroyomorales closed 4 years ago

jarroyomorales commented 4 years ago

Hello, I cloned this repo just to use the multi_step_wizard module in 11.0 but it forces me to install JIRA. I could pip install jira but since we dont use it for anything else I would like to avoid doing so. In 12.0 this module is moved to server-ux, but what can we do in 11.0? Thank you!

jarroyomorales commented 4 years ago

@guewen @alexey-pelykh I see you are who worked the most in this report, what do you think of this?

alexey-pelykh commented 4 years ago

@jarroyomorales upgrade to v12 :P I think installing multi_step_wizard manually is the only option so far?

jarroyomorales commented 4 years ago

@alexey-pelykh haha I'm sure we will try to go to 12 soon, but meanwhile... lets see if someone comes up with a solution, but yes, at least I have the option to add it manually

guewen commented 4 years ago

As the import errors when the jira lib is not installed are supposed to be ignored (https://github.com/OCA/connector-jira/blob/3d0e23cdf9e64769af4890569f10b45d5ce3d03b/connector_jira/components/backend_adapter.py#L16-L19), you should be able to use the repository even if you don't have the jira library.

Do you have a stack trace that you could copy-paste here?

jarroyomorales commented 4 years ago

The module installs properly but crashes when you try to refresh the page

2019-09-13 08:15:45,858 15391 ERROR ? werkzeug: Error on request: Traceback (most recent call last): File "/home/REINACB/jaime.arroyo/.local/lib/python3.5/site-packages/werkzeug/serving.py", line 303, in run_wsgi execute(self.server.app) File "/home/REINACB/jaime.arroyo/.local/lib/python3.5/site-packages/werkzeug/serving.py", line 291, in execute application_iter = app(environ, start_response) File "/home/REINACB/jaime.arroyo/pyworkspace/odoo/odoo/service/server.py", line 319, in app return self.app(e, s) File "/home/REINACB/jaime.arroyo/pyworkspace/odoo/odoo/service/wsgi_server.py", line 166, in application return application_unproxied(environ, start_response) File "/home/REINACB/jaime.arroyo/pyworkspace/odoo/odoo/service/wsgi_server.py", line 154, in application_unproxied result = handler(environ, start_response) File "/home/REINACB/jaime.arroyo/pyworkspace/odoo/odoo/http.py", line 1318, in call self.load_addons() File "/home/REINACB/jaime.arroyo/pyworkspace/odoo/odoo/http.py", line 1350, in load_addons m = import('odoo.addons.' + module) File "", line 969, in _find_and_load

File "", line 958, in _find_and_load_unlocked

File "", line 664, in _load_unlocked

File "", line 634, in _load_backward_compatible

File "/home/REINACB/jaime.arroyo/pyworkspace/odoo/odoo/modules/module.py", line 82, in load_module exec(open(modfile, 'rb').read(), new_mod.dict) File "", line 3, in

File "/home/REINACB/jaime.arroyo/pyworkspace/connector-jira/connector_jira/components/init.py", line 2, in from . import backend_adapter File "/home/REINACB/jaime.arroyo/pyworkspace/connector-jira/connector_jira/components/backend_adapter.py", line 25, in class JiraAdapter(Component): File "/home/REINACB/jaime.arroyo/pyworkspace/connector-jira/connector_jira/components/backend_adapter.py", line 46, in JiraAdapter base=jira.resources.Resource.JIRA_BASE_URL, NameError: name 'jira' is not defined

guewen commented 4 years ago

I see. In this method: https://github.com/OCA/connector-jira/blob/3d0e23cdf9e64769af4890569f10b45d5ce3d03b/connector_jira/components/backend_adapter.py#L42-L47

I think we could replace it by:

    def _post_get_json(
            self,
            path,
            data=None,
            base=None,
    ):
        if not base:
            base = jira.resources.Resource.JIRA_BASE_URL

That would defer the usage of jira to the runtime of the method, which will never happen in your case. Could you try? Would you mind creating a pull request then?

jarroyomorales commented 4 years ago

This works but gives another error later on, I'm going to create a PR and we can discuss there the errors that keep appearing.

jarroyomorales commented 4 years ago

There is already a PR so I think I can close this