Repository navigation
[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
Open
parabol123654 wants to merge 1 commit into
parabol123654 wants to merge 1 commit into
Conversation
…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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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"], butbase_import_asyncreadsoptions["chunk_size"], which nothing sends anymore (the comment says it came from the module'simport.js, which only setsuse_queuenow).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_sizeimports 3 partners withlimit=1and 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).