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

15.0 : import users crashes if odoo user doesn’t have ID ON JIRA #92

Open
yboujraf opened this issue Dec 13, 2022 · 2 comments
Open
Labels

Comments

@yboujraf
Copy link

yboujraf commented Dec 13, 2022

Dear @rvalyi , @ovnicraft , @pniederlag , @cmayo

Module

Connector-Jira

Describe the bug

GDPR issue because connector try to link with email address instead of ID on JIRA.

To Reproduce

Affected versions:
15.0

Steps to reproduce the behavior:

  1. Create user in odoo
  2. Don’t fill ID on JIRA (perhaps no user in Jira)
  3. Import users

Expected behavior
Link odoo user if JIRA ID IS NOT EMPTY

Best regards

@yboujraf
Copy link
Author

Dear,

Any news

BR

@yboujraf
Copy link
Author

Dear,

I found I have downloaded the bad branch 14.0 of oca/connector instead of 15.0.
Now it is done.

Python packages :

jira==2.0.0 and 3.4.1
requests-oauthlib==1.3.1
requests-toolbelt==0.10.1
oauthlib==3.1.0
PyJWT==1.7.1
cryptography==2.6.1

Jira error message

The query parameter 'username' is not supported in GDPR strict mode

Odoo Error :

RPC_ERROR
Odoo Server Error
Traceback (most recent call last):
File "/odoo/odoo-server/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
result = request.dispatch()
File "/odoo/odoo-server/odoo/http.py", line 687, in dispatch
result = self._call_function(**self.params)
File "/odoo/odoo-server/odoo/http.py", line 359, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/odoo/odoo-server/odoo/service/model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "/odoo/odoo-server/odoo/http.py", line 348, in checked_call
result = self.endpoint(*a, **kw)
File "/odoo/odoo-server/odoo/http.py", line 916, in call
return self.method(*args, **kw)
File "/odoo/odoo-server/odoo/http.py", line 535, in response_wrap
response = f(*args, **kw)
File "/odoo/odoo-server/addons/web/controllers/main.py", line 1346, in call_button
action = self._call_kw(model, method, args, kwargs)
File "/odoo/odoo-server/addons/web/controllers/main.py", line 1334, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/odoo/odoo-server/odoo/api.py", line 464, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/odoo/odoo-server/odoo/api.py", line 451, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "/odoo/custom/odoo15-addons/community/connector_jira/models/jira_backend/common.py", line 510, in import_res_users
result = self.env["res.users"].search([]).link_with_jira(backends=self)
File "/odoo/custom/odoo15-addons/community/connector_jira/models/res_users/common.py", line 63, in link_with_jira
jira_user = adapter.search(fragment=resolve_by_value)
File "/odoo/custom/odoo15-addons/community/connector_jira/models/res_users/common.py", line 152, in search
users = self.client.search_users(
File "/usr/local/lib/python3.8/dist-packages/jira/client.py", line 2330, in search_users
return self._fetch_pages(User, None, 'user/search', startAt, maxResults, params)
File "/usr/local/lib/python3.8/dist-packages/jira/client.py", line 575, in _fetch_pages
resource = self._get_json(request_path, params=page_params, base=base)
File "/usr/local/lib/python3.8/dist-packages/jira/client.py", line 2549, in _get_json
r = self._session.get(url, params=params)
File "/usr/local/lib/python3.8/dist-packages/jira/resilientsession.py", line 151, in get
return self.__verb('GET', url, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/jira/resilientsession.py", line 147, in __verb
raise_on_error(response, verb=verb, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/jira/resilientsession.py", line 56, in raise_on_error
raise JIRAError(
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/odoo/odoo-server/odoo/http.py", line 643, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/odoo/odoo-server/odoo/http.py", line 301, in _handle_exception
raise exception.with_traceback(None) from new_cause
jira.exceptions.JIRAError: JiraError HTTP 400 url: https://xxx.atlassian.net/rest/api/2/user/search?username=accounting%40xxx.be&includeActive=True&includeInactive=True
text: The query parameter 'username' is not supported in GDPR strict mode.

response headers = {'Date': 'Wed, 25 Jan 2023 11:55:06 GMT', 'Content-Type': 'application/json;charset=UTF-8', 'Server': 'AtlassianEdge', 'Timing-Allow-Origin': '*', 'X-Arequestid': 'dd01d911fe43bffe0804b9fea166e602', 'X-Aaccountid': '557058%3Ad1093106-4407-4799-89ee-72ff7e208584', 'Cache-Control': 'no-cache, no-store, no-transform', 'Expect-Ct': 'report-uri="https://web-security-reports.services.atlassian.com/expect-ct-report/atlassian-proxy", max-age=86400', 'X-Content-Type-Options': 'nosniff', 'X-Xss-Protection': '1; mode=block', 'Atl-Traceid': 'b0bdc580a8a6760b', 'Report-To': '{"endpoints": [{"url": "https://dz8aopenkvv6s.cloudfront.net"}], "group": "endpoint-1", "include_subdomains": true, "max_age": 600}', 'Nel': '{"failure_fraction": 0.001, "include_subdomains": true, "max_age": 600, "report_to": "endpoint-1"}', 'Strict-Transport-Security': 'max-age=63072000; includeSubDomains; preload', 'Transfer-Encoding': 'chunked'}
response text = {"errorMessages":["The query parameter 'username' is not supported in GDPR strict mode."],"errors":{}}

Best Regards
Youssef

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant