Skip to content
Snippets Groups Projects
Commit 260373d293d2 authored by Vincent Hatakeyama's avatar Vincent Hatakeyama
Browse files

:pencil: sort import files (in case they are numbered)

parent 84d3931485f5
No related branches found
No related tags found
No related merge requests found
......@@ -90,7 +90,7 @@
}
_logger.info(f"{len(model_filenames)} files to import")
for model, csv_file in model_filenames:
_logger.info('[ ] Importing - %s in model %s', csv_file, model)
_logger.info('Importing - %s in model %s', csv_file, model)
import_dlg_id = import_obj.create({'res_model': model})
with open(csv_file, 'rb') as f:
m = MultipartEncoder(
......@@ -236,7 +236,7 @@
if nmspc.directory:
for directory in nmspc.directory:
for root, subdirs, files in os.walk(directory):
file_list.extend(os.path.join(root, f) for f in files)
file_list.extend(os.path.join(root, f) for f in sorted(files))
for filename in file_list:
_logger.debug(f"{filename} to import")
model_csv = os.path.basename(filename).split(' ')[-1]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment