Skip to content

Commit

Permalink
[FIX][11.0] Remove enterprise related code
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoux authored and alexey-pelykh committed Feb 27, 2020
1 parent 2807cb1 commit d4b3396
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
7 changes: 1 addition & 6 deletions connector_jira/models/account_analytic_line/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from odoo import _
from odoo.addons.connector.exception import MappingError
from odoo.addons.connector.components.mapper import mapping, only_create
from odoo.addons.connector.components.mapper import mapping
from odoo.addons.component.core import Component
from ...components.mapper import (
iso8601_to_naive_date, iso8601_to_utc_datetime, whenempty
Expand All @@ -26,11 +26,6 @@ class AnalyticLineMapper(Component):
(whenempty('comment', _('missing description')), 'name'),
]

@only_create
@mapping
def default(self, record):
return {'is_timesheet': True}

@mapping
def issue(self, record):
issue = self.options.linked_issue
Expand Down
13 changes: 6 additions & 7 deletions connector_jira_tempo/models/jira_backend/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ def _update_ts_line_status(self, date_from, date_to, state, user_ids):
})
self._validate_ts(date_from, date_to, state, user_ids)

def _get_ts_lines(self, date_from, date_to, user_ids,
only_non_validated=False):
ts_line_model = self.env['account.analytic.line']
def _get_ts_lines_domain(self, date_from, date_to, user_ids):
domain = [
# TODO: any better filter here?
# `is_timesheet` is not available since we don't use ts_grid
Expand All @@ -106,10 +104,11 @@ def _get_ts_lines(self, date_from, date_to, user_ids,
('date', '<=', date_to),
('user_id', 'in', user_ids)
]
if only_non_validated:
domain.append(
('validated', '=', False)
)
return domain

def _get_ts_lines(self, date_from, date_to, user_ids):
ts_line_model = self.env['account.analytic.line']
domain = self._get_ts_lines_domain(date_from, date_to, user_ids)
return ts_line_model.search(domain)

def _validate_ts(self, date_from, date_to, state, user_ids):
Expand Down

0 comments on commit d4b3396

Please sign in to comment.