Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
AungKoKoLin1997 committed Nov 25, 2024
1 parent 8b46f3e commit b105791
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
4 changes: 2 additions & 2 deletions connector_ebisumart/components/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,8 @@ class DelayedBatchImporter(AbstractComponent):
def _import_record(self, external_id, job_options=None, **kwargs):
""" Delay the import of the records"""
job_options = job_options or {}
job_options['description'] = (
f'JOB: Import an Ebisumart record ({self.model._description})'
job_options["description"] = (
f"JOB: Import an Ebisumart record ({self.model._description}: {external_id})"
)
delayable = self.model.with_delay(**job_options)
delayable.import_record(self.backend_record, external_id, **kwargs)
21 changes: 9 additions & 12 deletions connector_ebisumart/models/ebisumart_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,15 @@ def add_checkpoint(self, record):
return add_checkpoint(self.env, record._name, record.id,
self._name, self.id)

def _get_job_description(self, model):
return (
f"JOB: Prepare the import of records modified in Ebisumart "
f"({self.env[model]._description})"
)

@api.multi
def _import_orders(self, model):
description = (
f'JOB: Prepare the import of records modified in Ebisumart '
f'({self.env[model]._description})'
)
description = self._get_job_description(model)
for backend in self:
self.env[model].with_delay(description=description).import_batch(
backend,
Expand All @@ -166,10 +169,7 @@ def _import_orders(self, model):

@api.multi
def _import_partners(self, model):
description = (
f'JOB: Prepare the import of records modified in Ebisumart '
f'({self.env[model]._description})'
)
description = self._get_job_description(model)
for backend in self:
self.env[model].with_delay(description=description).import_batch(
backend,
Expand All @@ -178,10 +178,7 @@ def _import_partners(self, model):

@api.multi
def _import_products(self, model):
description = (
f'JOB: Prepare the import of records modified in Ebisumart '
f'({self.env[model]._description})'
)
description = self._get_job_description(model)
for backend in self:
self.env[model].with_delay(description=description).import_batch(
backend,
Expand Down

0 comments on commit b105791

Please sign in to comment.