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

[17.0][WIP][MIG] connector_jira: Migration to 17.0 #108

Draft
wants to merge 113 commits into
base: 17.0
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
876fcf8
Add first brick of the connector_jira addon
guewen Nov 15, 2016
c97bb82
Update ir.model.access.csv
damdam-s Jan 10, 2017
fac216a
Set uninstallable
guewen Apr 19, 2017
503ea4f
C2C-152 Add project.task.jira_issue_url
simahawk Nov 20, 2018
1c9f464
add epic and issuetype to analytic line
Dec 13, 2018
ba7bd85
Test jira_key only if connector_no_export is True (#13)
Tonow-c2c Jan 4, 2019
039b16b
Better handling of users sync
simahawk Nov 27, 2018
8e5e7b1
Replace text_field by options
guewen Jan 30, 2019
2e6cfeb
Add connector_jira_servicedesk
p-tombez Jan 29, 2019
ef8e174
Read access tokens with sudo
guewen Feb 1, 2019
62b789b
Apply suggestions from code review
TDu Apr 8, 2019
096827e
Prevent error when linking users
guewen Apr 8, 2019
d12937b
Apply suggestions from code review
TDu Apr 10, 2019
0087734
Fix oldname field
guewen Apr 10, 2019
d221278
Fix psycopg2.ProgrammingError: syntax error when no updated_worklogs …
grindtildeath Apr 25, 2019
3b983b9
Make migration more robust
guewen Apr 8, 2019
002ee9d
Use fallback project when task or project is inactive
jcoux May 22, 2019
2e8ed01
Add base test class for worklog
simahawk May 8, 2019
3341be8
Allow several bindings on projects
guewen Jun 25, 2019
27e0656
[ADD] icon.png
OCA-git-bot Jul 12, 2019
9aff8e4
[MIG] connector_jira: Migration to 12.0
alexey-pelykh Jul 20, 2019
077d338
[IMP] connector_jira: improved user binding
alexey-pelykh Aug 11, 2019
2fba13d
connector_jira 12.0.1.0.1
OCA-git-bot Aug 20, 2019
7b5efb7
[IMP] connector_jira: do not track sync updates
alexey-pelykh Aug 11, 2019
e7fa993
connector_jira 12.0.1.0.2
OCA-git-bot Aug 20, 2019
9376bb5
[IMP] connector_jira: view JIRA keys on project and task views
alexey-pelykh Aug 11, 2019
c1fa545
connector_jira 12.0.1.1.0
OCA-git-bot Aug 23, 2019
4a76bd3
[IMP] connector_jira: restrict linked tasks alteration
alexey-pelykh Aug 11, 2019
bc414aa
[IMP] connector_jira: search by jira keys
alexey-pelykh Aug 24, 2019
278ddfc
connector_jira 12.0.1.2.0
OCA-git-bot Sep 2, 2019
681ac4f
[IMP] connector_jira: import estimation and status for tasks
alexey-pelykh Aug 23, 2019
474a968
[IMP] connector_jira: restrict linked AAL modification
alexey-pelykh Sep 1, 2019
51cd2c5
[FIX] connector_jira: issues can be moved between projects
alexey-pelykh Nov 7, 2019
088a151
[IMP] connector_jira: worklog/timesheet date timezone
alexey-pelykh Nov 8, 2019
057db01
[FIX] connector_jira: UI layout
alexey-pelykh Nov 21, 2019
71e4eb2
connector_jira 12.0.1.4.0
OCA-git-bot Dec 3, 2019
69cae0a
[IMP] connector_jira: write only updated values, validate by cache fo…
alexey-pelykh Dec 4, 2019
53ad6e7
connector_jira 12.0.1.5.0
OCA-git-bot Dec 5, 2019
39299b5
[IMP] connector_jira: forced import option
alexey-pelykh Nov 20, 2019
cba3121
connector_jira 12.0.1.6.0
OCA-git-bot Dec 5, 2019
fb7ac64
[IMP] connector_jira: consider archived employees
alexey-pelykh Feb 13, 2020
0ec6b9b
connector_jira 12.0.1.6.1
OCA-git-bot Feb 14, 2020
47515cf
[FIX][11.0] Remove enterprise related code
jcoux Feb 26, 2020
4cf43e9
connector_jira 12.0.1.6.2
OCA-git-bot Feb 27, 2020
297c64d
[13.0][MIG] connetor_jira: migration
Apr 25, 2020
f6f8e33
[REM] pot file
May 7, 2020
8757139
[IMP] apply black, isort
May 8, 2020
a12f683
connector_jira: Fix _compute_jira_issue_url dependencies
grindtildeath Aug 5, 2020
9d4fb93
connector_jira: Fix inconsistent 'compute_sudo' for computed fields
grindtildeath Aug 5, 2020
675090a
connector_jira: Fix parameter 'oldname' is not longer supported; use …
grindtildeath Aug 5, 2020
9895eeb
connector_jira: Fix view inheritance of project.link.jira
grindtildeath Aug 5, 2020
7f2e40e
connector_jira: Fix display of button in footer on project create form
grindtildeath Aug 5, 2020
a53dc6e
[FIX] remove use of deprecated method
gurneyalex Aug 24, 2020
abba43b
connector_jira: Add epic link on epic
grindtildeath Jul 31, 2020
ce55cdf
Pre-commit fixes
leemannd Jan 20, 2021
30162b5
prettier
leemannd Jan 20, 2021
81ce5cd
Fix missing assignement in compute function
leemannd Mar 8, 2021
dcbc9d7
connector_jira 13.0.1.0.1
OCA-git-bot Mar 11, 2021
e98bade
[FIX] set company_id on the task related to the project
vrenaville Apr 30, 2021
197d848
connector_jira 13.0.1.1.0
OCA-git-bot Jun 15, 2021
1d198a9
[IMP] connector_jira: black, isort, prettier
Jun 1, 2022
2f0c498
[15.0][MIG] connector_jira: Migrate to version 15.0
Jun 8, 2022
0bca123
[UPD] Update connector_jira.pot
Jul 6, 2022
a1ca62d
[UPD] README.rst
OCA-git-bot Jul 6, 2022
fd19196
[UPD] Brainbean Apps => CorporateHub
alexey-pelykh Jul 15, 2022
4ca08be
connector_jira: fix migration from 14.0
sebalix Jul 18, 2022
4e640e4
[15.0][FIX] fix issue with maxResults in url
Jul 14, 2022
5e1cf97
connector_jira 15.0.1.0.1
OCA-git-bot Jul 20, 2022
cc2be69
[UPD] README.rst
OCA-git-bot Jul 20, 2022
b283291
update_contributors
leemannd Jul 20, 2022
847ef40
[UPD] README.rst
OCA-git-bot Jul 20, 2022
a39d923
[UPD] Update connector_jira.pot
Jul 20, 2022
8318b70
[UPD] Brainbean Apps => CorporateHub
alexey-pelykh Nov 4, 2020
493f516
[UPD] README.rst
OCA-git-bot Jul 20, 2022
657f602
[UPD] README.rst
OCA-git-bot Sep 3, 2023
72d7b7e
Fix precommit flagged issues
gurneyalex Feb 7, 2024
fba4c5c
[FIX]: pin python packages dependency requirements
smussie Jan 10, 2024
f9c6857
fixup! fixup! [FIX]: pin python packages dependency requirements
gurneyalex Feb 16, 2024
ba75c16
[DRAFT] 11.0 Make Jira connector GDPR compliant
May 26, 2021
4b02982
[DRAFT] 11.0 Make Jira connector GDPR compliant
May 26, 2021
5357704
[DRAFT] 11.0 Make Jira connector GDPR compliant
May 27, 2021
e09c689
user mapping work
gurneyalex Feb 16, 2024
c97fcaa
update dependencies
gurneyalex Feb 16, 2024
f80832d
fixup! update dependencies
gurneyalex Feb 16, 2024
deb8d4a
fixup! fixup! update dependencies
gurneyalex Feb 16, 2024
ce63608
fixup! user mapping work
gurneyalex Feb 16, 2024
15b3ab9
install the Jira connector as a Jira Connect app
gurneyalex Mar 9, 2024
f9e849f
Design change: urls per jira backend
gurneyalex Mar 10, 2024
5a6bdd4
remove jira_backend_auth wizard
gurneyalex Mar 10, 2024
2a70796
remove jira_oauth_dance CLI tool
gurneyalex Mar 10, 2024
0a85ea0
fixup! remove jira_backend_auth wizard
gurneyalex Mar 10, 2024
89145a2
fixup! Design change: urls per jira backend
gurneyalex Mar 10, 2024
2128cc1
Implement JWT validation on all endpoints
gurneyalex Mar 11, 2024
f131b1d
fix scheduled actions: handle multiple backends
gurneyalex Mar 11, 2024
c5cdc52
update documentation, fix issues, remove tests
gurneyalex Mar 15, 2024
09db602
update documentation, fix issues, remove tests
gurneyalex Mar 15, 2024
9bfbaec
fixup! update documentation, fix issues, remove tests
gurneyalex Mar 15, 2024
6edd215
fixup! fixup! update documentation, fix issues, remove tests
gurneyalex Mar 15, 2024
cd51671
fixup! fixup! fixup! fixup! update documentation, fix issues, remove …
gurneyalex Mar 15, 2024
de2e92a
add migration script
gurneyalex Mar 15, 2024
da42960
fixup! add migration script
gurneyalex Mar 15, 2024
99c89b9
fixup! fixup! add migration script
gurneyalex Mar 16, 2024
c7fe104
add missing dependency on requests-jwt
gurneyalex Mar 16, 2024
94d8b8e
worklog import
gurneyalex Apr 10, 2024
b36c30e
fixup! add missing dependency on requests-jwt
gurneyalex Apr 10, 2024
8c1dcbd
fix migration script
gurneyalex Apr 10, 2024
84cb7d8
improve app description
gurneyalex Apr 10, 2024
25d2feb
Don't use the webhook payload for worklog
gurneyalex Apr 16, 2024
9de84af
Fix 'Link users' button
gurneyalex Apr 19, 2024
62e4a95
fixup! Implement JWT validation on all endpoints
gurneyalex Apr 26, 2024
26bd036
[IMP] connector_jira: pre-commit auto fixes
SilvioC2C Jun 24, 2024
c23c7ed
[ADD] OCA dependencies
SilvioC2C Jun 25, 2024
699a31f
[WIP][MIG] connector_jira: Migration to 17.0
SilvioC2C Jun 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[IMP] connector_jira: import estimation and status for tasks
  • Loading branch information
alexey-pelykh authored and SilvioC2C committed Jul 11, 2024
commit 681ac4f8015e5024fca522f225a88aab3557e577
4 changes: 2 additions & 2 deletions connector_jira/i18n/connector_jira.pot
Original file line number Diff line number Diff line change
@@ -1568,7 +1568,7 @@ msgstr ""

#. module: connector_jira
#: code:addons/connector_jira/models/account_analytic_line/importer.py:66
#: code:addons/connector_jira/models/project_task/importer.py:65
#: code:addons/connector_jira/models/project_task/importer.py:66
#, python-format
msgid "No user found with login \"%s\" or email \"%s\".You must create a user or link it manually if the login/email differs."
msgstr ""
@@ -1902,7 +1902,7 @@ msgid "Project Type"
msgstr ""

#. module: connector_jira
#: code:addons/connector_jira/models/project_task/importer.py:207
#: code:addons/connector_jira/models/project_task/importer.py:234
#, python-format
msgid "Project or issue type is not synchronized."
msgstr ""
29 changes: 28 additions & 1 deletion connector_jira/models/project_task/importer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright 2016-2019 Camptocamp SA
# Copyright 2019 Brainbean Apps (https://brainbeanapps.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from odoo import _
@@ -96,7 +97,7 @@ def epic(self, record):

@mapping
def parent(self, record):
jira_parent = record['fields'].get('parent', {})
jira_parent = record['fields'].get('parent')
if not jira_parent:
return {}
jira_parent_id = jira_parent['id']
@@ -108,6 +109,32 @@ def parent(self, record):
def backend_id(self, record):
return {'backend_id': self.backend_record.id}

@mapping
def status(self, record):
status = record['fields'].get('status', {})
status_name = status.get('name')
if not status_name:
return {'stage_id': False}
project_binder = self.binder_for('jira.project.project')
project_id = project_binder.unwrap_binding(
self.options.project_binding
)
stage = self.env['project.task.type'].search(
[
('name', '=', status_name),
('project_ids', '=', project_id.id),
],
limit=1,
)
return {'stage_id': stage.id}

@mapping
def time_estimate(self, record):
original_estimate = record['fields'].get('timeoriginalestimate')
if not original_estimate:
return {'planned_hours': False}
return {'planned_hours': float(original_estimate) / 3600.0}

def finalize(self, map_record, values):
values = values.copy()
if values.get('odoo_id'):
Original file line number Diff line number Diff line change
@@ -656,7 +656,7 @@ interactions:
body: {string: '{"expand":"renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations","id":"10001","self":"http://jira:8080/rest/api/2/issue/10001","key":"TEST-2","fields":{"issuetype":{"self":"http://jira:8080/rest/api/2/issuetype/10002","id":"10002","description":"A
task that needs to be done.","iconUrl":"http://jira:8080/secure/viewavatar?size=xsmall&avatarId=10318&avatarType=issuetype","name":"Task","subtask":false,"avatarId":10318},"timespent":null,"project":{"self":"http://jira:8080/rest/api/2/project/10000","id":"10000","key":"TEST","name":"TEST","avatarUrls":{"48x48":"http://jira:8080/secure/projectavatar?avatarId=10324","24x24":"http://jira:8080/secure/projectavatar?size=small&avatarId=10324","16x16":"http://jira:8080/secure/projectavatar?size=xsmall&avatarId=10324","32x32":"http://jira:8080/secure/projectavatar?size=medium&avatarId=10324"}},"fixVersions":[],"aggregatetimespent":null,"resolution":null,"customfield_10105":"0|i00007:","resolutiondate":null,"workratio":-1,"lastViewed":"2019-04-08T13:51:10.599+0000","watches":{"self":"http://jira:8080/rest/api/2/issue/TEST-2/watchers","watchCount":1,"isWatching":true},"created":"2019-04-04T09:58:51.611+0000","priority":{"self":"http://jira:8080/rest/api/2/priority/3","iconUrl":"http://jira:8080/images/icons/priorities/medium.svg","name":"Medium","id":"3"},"customfield_10100":null,"customfield_10101":"TEST-1","labels":[],"timeestimate":null,"aggregatetimeoriginalestimate":null,"versions":[],"issuelinks":[],"assignee":null,"updated":"2019-04-04T09:58:51.785+0000","status":{"self":"http://jira:8080/rest/api/2/status/10000","description":"","iconUrl":"http://jira:8080/","name":"To
Do","id":"10000","statusCategory":{"self":"http://jira:8080/rest/api/2/statuscategory/2","id":2,"key":"new","colorName":"blue-gray","name":"To
Do"}},"components":[],"timeoriginalestimate":null,"description":"my task","timetracking":{},"customfield_10203":null,"customfield_10204":null,"customfield_10205":null,"customfield_10206":null,"attachment":[],"customfield_10207":null,"aggregatetimeestimate":null,"customfield_10208":null,"summary":"Task1","creator":{"self":"http://jira:8080/rest/api/2/user?username=gbaconnier","name":"gbaconnier","key":"gbaconnier","emailAddress":"[email protected]","avatarUrls":{"48x48":"https://www.gravatar.com/avatar/ad252192c3f73885676b7d2e850ad13c?d=mm&s=48","24x24":"https://www.gravatar.com/avatar/ad252192c3f73885676b7d2e850ad13c?d=mm&s=24","16x16":"https://www.gravatar.com/avatar/ad252192c3f73885676b7d2e850ad13c?d=mm&s=16","32x32":"https://www.gravatar.com/avatar/ad252192c3f73885676b7d2e850ad13c?d=mm&s=32"},"displayName":"Guewen
Do"}},"components":[],"timeoriginalestimate":16200,"description":"my task","timetracking":{},"customfield_10203":null,"customfield_10204":null,"customfield_10205":null,"customfield_10206":null,"attachment":[],"customfield_10207":null,"aggregatetimeestimate":null,"customfield_10208":null,"summary":"Task1","creator":{"self":"http://jira:8080/rest/api/2/user?username=gbaconnier","name":"gbaconnier","key":"gbaconnier","emailAddress":"[email protected]","avatarUrls":{"48x48":"https://www.gravatar.com/avatar/ad252192c3f73885676b7d2e850ad13c?d=mm&s=48","24x24":"https://www.gravatar.com/avatar/ad252192c3f73885676b7d2e850ad13c?d=mm&s=24","16x16":"https://www.gravatar.com/avatar/ad252192c3f73885676b7d2e850ad13c?d=mm&s=16","32x32":"https://www.gravatar.com/avatar/ad252192c3f73885676b7d2e850ad13c?d=mm&s=32"},"displayName":"Guewen
Baconnier","active":true,"timeZone":"GMT"},"subtasks":[{"id":"10002","key":"TEST-3","self":"http://jira:8080/rest/api/2/issue/10002","fields":{"summary":"Subtask1","status":{"self":"http://jira:8080/rest/api/2/status/10000","description":"","iconUrl":"http://jira:8080/","name":"To
Do","id":"10000","statusCategory":{"self":"http://jira:8080/rest/api/2/statuscategory/2","id":2,"key":"new","colorName":"blue-gray","name":"To
Do"}},"priority":{"self":"http://jira:8080/rest/api/2/priority/3","iconUrl":"http://jira:8080/images/icons/priorities/medium.svg","name":"Medium","id":"3"},"issuetype":{"self":"http://jira:8080/rest/api/2/issuetype/10003","id":"10003","description":"The
7 changes: 7 additions & 0 deletions connector_jira/tests/test_import_task.py
Original file line number Diff line number Diff line change
@@ -25,6 +25,11 @@ def setUpClass(cls):
cls.project = cls.env['project.project'].create({
'name': 'Jira Project',
})
cls.env['project.task.type'].create({
'name': 'To Do',
'sequence': 1,
'project_ids': [(4, cls.project.id)],
})

@recorder.use_cassette
def test_import_task_epic(self):
@@ -64,6 +69,7 @@ def _test_import_task_epic(self, expected_active):
self.assertFalse(binding.jira_parent_id)

self.assertEqual(binding.odoo_id.active, expected_active)
self.assertEqual(binding.odoo_id.stage_id.name, 'To Do')

with self.assertRaises(exceptions.UserError):
binding.odoo_id.active = not expected_active
@@ -125,6 +131,7 @@ def test_import_task_parents(self):
self.assertEqual(task_binding.jira_issue_type_id,
self.task_issue_type)
self.assertTrue(task_binding.jira_epic_link_id)
self.assertAlmostEqual(task_binding.odoo_id.planned_hours, 4.5)

epic_binding = task_binding.jira_epic_link_id
self.assertEqual(epic_binding.jira_key, 'TEST-1')