Skip to content

Commit 24791f3

Browse files
committed
..
1 parent 9376b49 commit 24791f3

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

base_import_async/models/base_import_import.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@ def execute_import(self, fields, columns, options, dryrun=False):
5252
translated_model_name = search_result[0][1]
5353
else:
5454
translated_model_name = self._description
55-
description = _("Import %s from file %s") % (
56-
translated_model_name,
57-
self.file_name,
55+
description = _(
56+
"Import %(translated_model_name)s from file %(file_name)s",
57+
translated_model_name=translated_model_name,
58+
file_name=self.file_name,
5859
)
5960
file_name = self.file_name
6061
if not file_name.endswith(".csv"):
@@ -152,13 +153,14 @@ def _split_file(
152153
model_obj, fields, data, chunk_size
153154
):
154155
chunk = str(priority - INIT_PRIORITY).zfill(padding)
155-
description = _("Import %s from file %s - #%s - lines %s to %s")
156-
description = description % (
157-
translated_model_name,
158-
file_name,
159-
chunk,
160-
row_from + 1 + header_offset,
161-
row_to + 1 + header_offset,
156+
description = _(
157+
"Import %(translated_model_name)s from file %(file_name)s"
158+
" - #%(chunk)s - lines %(row_from)s to %(row_to)s",
159+
translated_model_name=translated_model_name,
160+
file_name=file_name,
161+
chunk=chunk,
162+
row_from=row_from + 1 + header_offset,
163+
row_to=row_to + 1 + header_offset,
162164
)
163165
# create a CSV attachment and enqueue the job
164166
root, ext = splitext(file_name)

base_import_async/static/src/xml/import.xml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,15 @@
77
after splitting your file in small chunks that will be processed independently.
88
Use this to import very large files."
99
>
10-
<input type="checkbox" class="oe_import_queue" id="oe_import_queue" />
11-
<label for="oe_import_queue">Import in the background</label>
10+
<input
11+
type="checkbox"
12+
class="oe_import_queue custom-control-input"
13+
id="oe_import_queue"
14+
/>
15+
<label
16+
for="oe_import_queue"
17+
class="custom-control-label"
18+
>Import in the background</label>
1219
</div>
1320
</t>
1421
</t>

0 commit comments

Comments
 (0)