Skip to content

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

Merged
YoussefEgla merged 3 commits into19.0from
19.0-mig-base_import_async
Apr 17, 2026
Merged

[19.0][MIG] base_import_async: migration to 19.0#1
YoussefEgla merged 3 commits into19.0from
19.0-mig-base_import_async

Conversation

@YoussefEgla
Copy link
Copy Markdown
Owner

@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 is still present as an unported placeholder with installable = False.

This migration activates the addon and aligns its async import flow with the current Odoo 19 import internals.

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.

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

  • Python syntax validation with py_compile on the migrated model and test files.
  • 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.
  • The migration is intentionally narrow: no extra features were added beyond the compatibility fixes required to make the addon behave correctly on Odoo 19.

@YoussefEgla YoussefEgla merged commit b18ef15 into 19.0 Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant