Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion connector_importer/models/record.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import base64
import json
import os
import threading

from odoo import api, fields, models

Expand Down Expand Up @@ -75,7 +76,9 @@ def debug_mode(self):
def _should_use_jobs(self):
self.ensure_one()
debug_mode = self.debug_mode()
if debug_mode:
if debug_mode and not getattr(
threading.current_thread(), "testing", False
): # pragma: no cover
logger.warning("### DEBUG MODE ACTIVE: WILL NOT USE QUEUE ###")
use_job = self.recordset_id.import_type_id.use_job
if debug_mode:
Expand Down
6 changes: 5 additions & 1 deletion connector_importer/models/recordset.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import base64
import json
import os
import threading
from collections import OrderedDict

from odoo import api, fields, models
Expand Down Expand Up @@ -321,7 +322,10 @@ def run_import(self):
"""queue a job for creating records (import.record items)"""
job_method = self.with_delay().import_recordset
if self.debug_mode():
logger.warning("### DEBUG MODE ACTIVE: WILL NOT USE QUEUE ###")
if not getattr(
threading.current_thread(), "testing", False
): # pragma: no cover
logger.warning("### DEBUG MODE ACTIVE: WILL NOT USE QUEUE ###")
job_method = self.import_recordset

for item in self:
Expand Down