Skip to main content

Asynchronous Import

Beta License: AGPL-3 OCA/queue Translate me on Weblate Try me on Runbot

This module extends the standard CSV import functionality to import files in the background using the OCA/queue framework.

Table of contents

Usage

The user is presented with a new checkbox in the import screen. When selected, the import is delayed in a background job.

This job in turn splits the CSV file in chunks of minimum 100 lines (or more to align with record boundaries). Each chunk is then imported in a separate background job.

When an import fails, the job is marked as such and the user can read the error in the job status. The CSV chunk being imported is stored as an attachment to the job, making it easy to download it, fix it and run a new import, possibly in synchronous mode since the chunks are small.

Any file that can be imported by the standard import mechanism can also be imported in the background.

This module’s scope is limited to making standard imports asynchronous. It does not attempt to transform the data nor automate ETL flows.

Other modules may benefit from this infrastructure in the following way (as illustrated in the test suite):

  1. create an instance of base_import.import and populate its fields (res_model, file, file_name),

  2. invoke the do method with appropriate options (header, encoding, separator, quoting, use_queue, chunk_size).

Known issues / Roadmap

  • There is currently no user interface to control the chunk size, which is currently 100 by default. Should this proves to be an issue, it is easy to add an option to extend the import screen.

  • Validation cannot be run in the background.

Changelog

11.0.2.0.0 (2019-07-08)

  • Add dependency with module ‘queue_job_batch’, allowing the user to display the progress of the import from the top bar.

11.0.1.0.0 (2018-06-26)

  • [BREAKING] In the do method the use_connector option has changed to use_queue.

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits

Authors

  • Akretion

  • ACSONE SA/NV

Contributors

Sébastien Beau (Akretion) authored the initial prototype.

Stéphane Bidoul (ACSONE) extended it to version 1.0 to support multi-line records, store data to import as attachments and let the user control the asynchronous behaviour.

Other contributors include:

  • Anthony Muschang (ACSONE)

  • David Béal (Akretion)

  • Jonathan Nemry (ACSONE)

  • Laurent Mignon (ACSONE)

  • Dennis Sluijk (Onestein)

Maintainers

This module is maintained by the OCA.

Odoo Community Association

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

This module is part of the OCA/queue project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

Metadata

Release files for odoo11-addon-base-import-async 11.0.2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for odoo11-addon-base-import-async 11.0.2.0.1
File Interpreter ABI Platform Actions
odoo11_addon_base_import_async-11.0.2.0.1-py2.py3-none-any.whl Python 3, Python 2 none any Details for odoo11_addon_base_import_async-11.0.2.0.1-py2.py3-none-any.whl

Release files / odoo11_addon_base_import_async-11.0.2.0.1-py2.py3-none-any.whl

Download URL odoo11_addon_base_import_async-11.0.2.0.1-py2.py3-none-any.whl
Size 30.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
3ef4e82012a37c0cc8b1139c5f8d96a810f90eb1037180abe2eeb9355a21ee79
BLAKE2b-256 checksum
How to use checksums
7fab745223b973b21abe091ec9b4ca8f60c6c0121cb150bab8f44bade70acc69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/56.2.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.5

Security for odoo11-addon-base-import-async 11.0.2.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page