Skip to content

[MIG] export_bg: Migration to 20.0 - #512

Closed
les-adhoc wants to merge 6 commits into
ingadhoc:20.0from
adhoc-dev:20.0-t-76642-les
Closed

les-adhoc wants to merge 6 commits into
ingadhoc:20.0from
adhoc-dev:20.0-t-76642-les

Conversation

@les-adhoc

Copy link
Copy Markdown
Contributor

Tarea: https://www.adhoc.inc/odoo/project.task/76642

Migrates export_bg from 19.0 to 20.0. Depends on base_bg, already merged in 20.0.

Changes

  • ir.attachment.datas does not exist in 20.0: chunks and the final file are written with raw and read with raw.content.
  • ir.config_parameter.get_param was removed: the threshold uses get_int("export_bg.record_threshold", 500) (same default as before).
  • CSVExport.from_data returns bytes in 20.0 (odoo/odoo@e3c7ff62d7fa, web/controllers/export.py), so the .encode() call broke every CSV export in background. Removed.
  • The 20.0 export dialog can export translatable fields in several languages. The background branch now sends getFieldsToExport(), the same fields the standard button sends.
  • upgrade_code 19.5-00-material-symbols-icons: the download icon of the chat message uses Material Symbols.
  • README synced with 20.0 and es.po exported and translated for 20.0.
  • No changes in depends, auto_install or license. No data migration script needed: the module has no stored fields or models of its own.

Tests

The module had no tests in 19.0. Added 4 tests for 20.0 (tests/test_export_bg.py):

  • threshold from the system parameter and its default;
  • CSV export in 3 chunks combined into one file, with the intermediate attachments removed;
  • XLSX export in 3 chunks;
  • export started by an internal user that is not an administrator (in 20.0 bg.job is only visible to its creator).

Local 20.0 database: the module installs and the 4 tests pass. Also checked in the browser: under the threshold the file downloads at once; over it, the export goes to background and the chat message brings the download link to a single CSV with all the records.

Not changed (pre-existing in 19.0)

  • In a grouped list, root.count is the number of groups, so the background export rarely triggers there.
  • The XLSX ignores the result of write_row and can be truncated without warning over the row limit.
  • With more than 10 chunks, order="name" sorts chunk_10 before chunk_2.

- ir.attachment has no datas field in 20.0: chunks and the final file
  are written and read with raw (bytes in, raw.content out).
- ir.config_parameter.get_param was removed: the threshold uses get_int,
  with 500 as default as before.
- web CSVExport.from_data returns bytes in 20.0, so the .encode() call
  broke every CSV export in background.
- The export dialog in 20.0 can export translatable fields in several
  languages (getFieldsToExport). The background branch now sends the
  same fields the standard button sends.
@roboadhoc

Copy link
Copy Markdown
Contributor

Pull request status dashboard

@les-adhoc
les-adhoc marked this pull request as ready for review November 12, 2026 13:11
@mav-adhoc

Copy link
Copy Markdown
Contributor

@roboadhoc r+ nobump rebase-ff

@roboadhoc

Copy link
Copy Markdown
Contributor

Merge method set to rebase and fast-forward.

@les-adhoc

Copy link
Copy Markdown
Contributor Author

@roboadhoc check

@roboadhoc

Copy link
Copy Markdown
Contributor

Updated message. No update to pr head.

@les-adhoc

Copy link
Copy Markdown
Contributor Author

@roboadhoc retry

@roboadhoc

Copy link
Copy Markdown
Contributor

@les-adhoc retry makes no sense when the PR is not in error.

@mav-adhoc

Copy link
Copy Markdown
Contributor

@roboadhoc r+ nobump rebase-ff

@roboadhoc

Copy link
Copy Markdown
Contributor

Merge method set to rebase and fast-forward.

roboadhoc pushed a commit that referenced this pull request Nov 12, 2026
Part-of: #512
Signed-off-by: Matias Velazquez <[email protected]>
roboadhoc pushed a commit that referenced this pull request Nov 12, 2026
roboadhoc pushed a commit that referenced this pull request Nov 12, 2026
- ir.attachment has no datas field in 20.0: chunks and the final file
  are written and read with raw (bytes in, raw.content out).
- ir.config_parameter.get_param was removed: the threshold uses get_int,
  with 500 as default as before.
- web CSVExport.from_data returns bytes in 20.0, so the .encode() call
  broke every CSV export in background.
- The export dialog in 20.0 can export translatable fields in several
  languages (getFieldsToExport). The background branch now sends the
  same fields the standard button sends.

Part-of: #512
Signed-off-by: Matias Velazquez <[email protected]>
roboadhoc pushed a commit that referenced this pull request Nov 12, 2026
roboadhoc pushed a commit that referenced this pull request Nov 12, 2026
Part-of: #512
Signed-off-by: Matias Velazquez <[email protected]>
@roboadhoc roboadhoc closed this in 43829e5 Nov 12, 2026
@roboadhoc roboadhoc added the 19.1 label Nov 12, 2026
@roboadhoc
roboadhoc deleted the 20.0-t-76642-les branch November 12, 2026 19:06

This branch was previously deployed

1 inactive deployment
merge — d54be465 Deployed Nov 12, 2026 by roboadhoc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants