Skip to content

Commit

Permalink
prettier, black, pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
leemannd committed Feb 10, 2021
1 parent 1614e8e commit 3b626e4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 18 deletions.
25 changes: 11 additions & 14 deletions connector_jira_servicedesk/models/account_analytic_line/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,34 @@


class JiraAccountAnalyticLine(models.Model):
_inherit = 'jira.account.analytic.line'
_inherit = "jira.account.analytic.line"

jira_servicedesk_issue_url = fields.Char(
string='Original JIRA issue Link',
compute='_compute_jira_servicedesk_issue_url',
string="Original JIRA issue Link",
compute="_compute_jira_servicedesk_issue_url",
)

@api.depends('jira_issue_key')
@api.depends("jira_issue_key")
def _compute_jira_servicedesk_issue_url(self):
"""Compute the external URL to JIRA service desk."""
for record in self:
jira_project = fields.first(self.project_id.jira_bind_ids)
if jira_project and record.jira_issue_key:
record.jira_servicedesk_issue_url = jira_project.\
make_servicedesk_issue_url(
record.jira_issue_key
)
record.jira_servicedesk_issue_url = jira_project.make_servicedesk_issue_url( # noqa:
record.jira_issue_key
)


class AccountAnalyticLine(models.Model):
_inherit = 'account.analytic.line'
_inherit = "account.analytic.line"

jira_servicedesk_issue_url = fields.Char(
string='Original JIRA service desk issue Link',
compute='_compute_jira_servicedesk_issue_url',
string="Original JIRA service desk issue Link",
compute="_compute_jira_servicedesk_issue_url",
readonly=True,
)

@api.depends(
'jira_bind_ids.jira_servicedesk_issue_url',
)
@api.depends("jira_bind_ids.jira_servicedesk_issue_url",)
def _compute_jira_servicedesk_issue_url(self):
"""Compute the service desk references to JIRA.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def __init__(self, work_context):
self.client._session.headers.update(self._desk_headers)

def read(self, id_):
# pylint: disable=method-required-super
organization = Organization(self.client._options, self.client._session)
with self.handle_404():
organization.find(id_)
Expand Down
4 changes: 2 additions & 2 deletions connector_jira_servicedesk/views/jira_backend_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@
attrs="{'invisible': [('state', '=', 'authenticate')]}"
/>
<p class="oe_grey oe_inline">
Activate the synchronization of the Organization field.
Activate the synchronization of the Organization field.
Only on JIRA ServiceDesk. The field contains the name of
the JIRA custom field that contains the Organization.
</p>
</p>
</group>
</xpath>
</field>
Expand Down
5 changes: 3 additions & 2 deletions connector_jira_servicedesk/views/project_link_jira_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
/>
<div colspan="2">
<p class="oe_grey oe_inline">
The organizations you choose will define how the tasks and worklogs are attached to the project.
The organizations you choose will define how the tasks and
worklogs are attached to the project.
If a task is assigned to an organization, it will be assigned
to an Odoo project linked to the JIRA project only if the
organization match. If no project with an organization exists,
the task will be assigned to a linked project without organization.
If no such project exists in Odoo, the task is ignored.
</p>
</p>
</div>
</group>
</group>
Expand Down

0 comments on commit 3b626e4

Please sign in to comment.