Skip to content

[18.0][FIX] base_import_async: use the batch limit of the import dialog as chunk size - #1024

Open
parabol123654 wants to merge 1 commit into
OCA:18.0from
parabol123654:18.0-fix-base_import_async-chunk_size
Open

parabol123654 wants to merge 1 commit into
OCA:18.0from
parabol123654:18.0-fix-base_import_async-chunk_size

Conversation

@parabol123654

Copy link
Copy Markdown

Port of #878 (16.0) to 18.0.

Problem: with "Import in the background" checked, the batch size set in the import dialog ("Batch limit") is ignored: the file is always split in chunks of 100 lines. Odoo's import dialog sends the batch size as options["limit"], but base_import_async reads options["chunk_size"], which nothing sends anymore (the comment says it came from the module's import.js, which only sets use_queue now).

Fix: read the chunk size from options["limit"], as done in 16.0 by #878. The default of 100 is still used when no limit is given (e.g. from scripts).

Note: since the dialog's default batch limit is 2000, an import that keeps the default is now split in chunks of 2000 lines instead of 100, i.e. what the dialog shows.

Test: test_async_import_uses_batch_limit_as_chunk_size imports 3 partners with limit=1 and checks that the split job creates 3 chunk jobs. Without the fix it fails (1 != 3); with the fix it passes, along with the rest of the module's tests (3 tests on Odoo 18.0).

…chunk size

The import dialog sends the batch size as options["limit"], but the
module read options["chunk_size"], which nothing sends. Background
imports were always split in chunks of 100 lines.

Port of OCA#878 (16.0).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:base_import_async Module base_import_async series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants