Skip to content

[19.0][MIG] base_import_async: migration to 19.0#918

Open
YoussefEgla wants to merge 3 commits intoOCA:19.0from
YoussefEgla:19.0-mig-base_import_async
Open

[19.0][MIG] base_import_async: migration to 19.0#918
YoussefEgla wants to merge 3 commits intoOCA:19.0from
YoussefEgla:19.0-mig-base_import_async

Conversation

@YoussefEgla
Copy link
Copy Markdown

@YoussefEgla YoussefEgla commented Apr 17, 2026

This PR ports base_import_async to 19.0.

The queue repository already contains queue_job ported on the 19.0 branch, while base_import_async was still present as an unported placeholder with installable = False.

This migration activates the addon and aligns its async import flow with current Odoo 19 import internals, while also bringing the addon layout and translations in line with the repository's current pre-commit and pylint expectations.

What changed

  • Bumped the addon version to 19.0.1.0.0.
  • Set installable = True.
  • Updated the async execute_import() path to mirror Odoo 19 preprocessing before queueing:
    • ensure_one()
    • _parse_datetime_data()
    • _handle_multi_mapping()
    • _handle_fallback_values()
  • Preserved import execution context when chunk jobs call load():
    • tracking_disable
    • name_create_enabled_fields
    • import_set_empty_fields
    • import_skip_records
  • Dropped the obsolete odoo.api.returns usage, which is no longer available in Odoo 19.
  • Fixed the related attachment action so it resolves the actual ir.attachment linked to the queue.job record via res_model / res_id, instead of relying on stored job kwargs.
  • Moved the transient base_import.import override under wizards/ to satisfy the repository's mandatory addon structure checks for TransientModel classes.
  • Updated translated strings to use self.env._(...) with named placeholders so the addon complies with the current mandatory pylint translation rules.
  • Synced generated addon and repository metadata after making the addon installable.

Test updates

The test module was rewritten to cover the migrated behavior more directly.

Added or updated coverage for:

  • Normal synchronous import still working.
  • Async import scheduling and execution of chunk jobs.
  • Datetime prevalidation before queueing.
  • Fallback values being applied in the async path.
  • Related attachment action opening the linked attachment.

The tests were also adapted to the Odoo 19 import wizard expectations by creating base_import.import records with raw file bytes instead of base64-encoded content.

Validation performed

  • Targeted pre-commit validation on the touched Python files:
    • ruff
    • ruff-format
    • pylint_odoo
  • Editor diagnostics reported no errors on the migrated addon.
  • Manual functional validation was also performed on an Odoo 19 deployment: importing contacts with "Import in the background" created chunk jobs and those jobs completed successfully.

Notes for reviewers

  • This PR only covers base_import_async.
  • queue_job is already ported on 19.0 and is not modified here for migration purposes.
  • The README / description / generated metadata refresh is expected once the addon becomes installable again.
  • The migration is intentionally narrow: no extra features were added beyond the compatibility and repository-compliance fixes required to make the addon behave correctly on Odoo 19.

@YoussefEgla YoussefEgla force-pushed the 19.0-mig-base_import_async branch from 1d0a8ac to 1cb6f6d Compare April 17, 2026 17:21
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:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants