[19.0][MIG] attachment_queue: Migration to 19.0#2
Closed
dnplkndll wants to merge 68 commits into
Closed
Conversation
Co-authored-by: Raphaël Valyi <rvalyi@akretion.com>
Refactore the conccurent attachment run, we lock the attachment now instead of using the concurent update concept. Move the attachment queue menu from settings to Queue app Fix failure email template Rename the default attachment channel
* Manifest version → 19.0.1.0.0 (T07).
* self._cr → self.env.cr in models/attachment_queue.py SQL exec
(T01 — self._cr is deprecated in Odoo 19).
* Delete migrations/18.0.1.0.0/ — pre-migrate script no longer
applies in 19.0 (T08).
* W8161: bare _(...) → self.env._(...) in tests/test_models.py
fake-model fixtures (Odoo 19 deprecates direct `_` import).
* Search view (views/attachment_queue_view.xml):
- <field> elements re-ordered to all precede <filter>/<separator>/<group>
(Odoo 19 RelaxNG: search view children must be type-grouped).
- <group expand="0" string="Group By"> wrapper removed — Odoo 19
group-by filters live at the top level of <search>.
* Mail template body (data/mail_template.xml): ${object.x} → {{object.x}}
(Mako removed in 19; Jinja is the only supported render syntax).
* Tests refactored from odoo_test_helper.FakeModelLoader → native
odoo.orm.model_classes.add_to_registry pattern. odoo-test-helper is
incompatible with 19 (MetaModel.module_to_models renamed/privatized).
setUp/tearDown collapsed into setUpClass with addClassCleanup.
* README.rst + static/description/index.html regenerated from
readme/ fragments.
Test results (--test-tags=/attachment_queue on doodba 19 local stack):
6 of 8 tests pass cleanly. Two known follow-ups, NOT addressed here:
1. test_run_fails_rollback — fails with empty mail.mail.email_to.
The mail template's `{{object.failure_emails}}` renders to ""
when the fake-model override of _get_failure_emails should
return "test@test.com". Looks like a mail-template-render-env
change in 19 (the renderer may use the base attachment.queue
class rather than the registry-augmented fake class). Needs
maintainer judgment — either patch the test to mock the
compute directly, or accept the mail.template renderer
behavior change for fake-model inheritance.
2. tearDownClass error — `addClassCleanup(cls.registry.__delitem__,
"attachment.queue")` orphans a related model
attachment.queue.reschedule.attachment_ids (Many2many) on
subsequent _setup_models__ pass. The native 19 add_to_registry
teardown doesn't cascade to dependents the way odoo-test-helper
did. Probably needs a more careful cleanup sequence — re-setup
after delete, or explicit handling of the dependent model.
Signed-off-by: Don Kendall <dkendall@ledoweb.com>
2e627ca to
3d2e4b2
Compare
dnplkndll
added a commit
that referenced
this pull request
May 20, 2026
…ch (temp) Until #2 merges and the 19.0 wheel publishes, pip-install attachment_queue from the open migration PR branch via whool. To be reverted before opening the upstream OCA PR.
dnplkndll
added a commit
that referenced
this pull request
May 20, 2026
…en PR branch Until #2 merges and the 19.0 wheel publishes, pip-install attachment_queue from the open migration PR branch via whool. Must be reverted before this PR is filed upstream to OCA.
Author
|
Filed upstream as OCA#3614 — closing mirror, branch retained. |
dnplkndll
added a commit
that referenced
this pull request
May 20, 2026
* Manifest version → 19.0.1.0.0 (T07). * Delete migrations/18.0.1.0.0/ — pre-migrate script no longer applies in 19.0 (T08). * odoo.osv.expression → odoo.fields.Domain: import + the one expression.AND([d, ...]) call in run_task_import_scheduler rewritten as variadic Domain.AND(d, ...). * tracking_disable=True added to SyncCommon.setUpClass test context (covers test_export, test_import via inheritance). * README.rst + static/description/index.html regenerated from readme/ fragments. CI dep-chain note: attachment_synchronize depends on attachment_queue, which is not yet on OCA/server-tools 19.0 (it's in #2, our fork PR awaiting upstream). Until that lands, `test with Odoo` / `test with OCB` will fail at the install step ("No matching distribution found for odoo-addon-attachment_queue==19.0.*"). The migration code itself is complete and reviewable; CI will go green automatically once attachment_queue lands on OCA/19.0. Signed-off-by: Don Kendall <dkendall@ledoweb.com>
dnplkndll
added a commit
that referenced
this pull request
May 20, 2026
…en PR branch Until #2 merges and the 19.0 wheel publishes, pip-install attachment_queue from the open migration PR branch via whool. Must be reverted before this PR is filed upstream to OCA.
dnplkndll
added a commit
that referenced
this pull request
May 20, 2026
* Manifest version → 19.0.1.0.0 (T07). * Delete migrations/18.0.1.0.0/ — pre-migrate script no longer applies in 19.0 (T08). * odoo.osv.expression → odoo.fields.Domain: import + the one expression.AND([d, ...]) call in run_task_import_scheduler rewritten as variadic Domain.AND(d, ...). * tracking_disable=True added to SyncCommon.setUpClass test context (covers test_export, test_import via inheritance). * README.rst + static/description/index.html regenerated from readme/ fragments. CI dep-chain note: attachment_synchronize depends on attachment_queue, which is not yet on OCA/server-tools 19.0 (it's in #2, our fork PR awaiting upstream). Until that lands, `test with Odoo` / `test with OCB` will fail at the install step ("No matching distribution found for odoo-addon-attachment_queue==19.0.*"). The migration code itself is complete and reviewable; CI will go green automatically once attachment_queue lands on OCA/19.0. Signed-off-by: Don Kendall <dkendall@ledoweb.com>
dnplkndll
added a commit
that referenced
this pull request
May 20, 2026
…en PR branch Until #2 merges and the 19.0 wheel publishes, pip-install attachment_queue from the open migration PR branch via whool. Must be reverted before this PR is filed upstream to OCA.
dnplkndll
added a commit
that referenced
this pull request
May 20, 2026
* Manifest version → 19.0.1.0.0 (T07). * Delete migrations/18.0.1.0.0/ — pre-migrate script no longer applies in 19.0 (T08). * odoo.osv.expression → odoo.fields.Domain: import + the one expression.AND([d, ...]) call in run_task_import_scheduler rewritten as variadic Domain.AND(d, ...). * tracking_disable=True added to SyncCommon.setUpClass test context (covers test_export, test_import via inheritance). * README.rst + static/description/index.html regenerated from readme/ fragments. CI dep-chain note: attachment_synchronize depends on attachment_queue, which is not yet on OCA/server-tools 19.0 (it's in #2, our fork PR awaiting upstream). Until that lands, `test with Odoo` / `test with OCB` will fail at the install step ("No matching distribution found for odoo-addon-attachment_queue==19.0.*"). The migration code itself is complete and reviewable; CI will go green automatically once attachment_queue lands on OCA/19.0. Signed-off-by: Don Kendall <dkendall@ledoweb.com>
dnplkndll
added a commit
that referenced
this pull request
May 20, 2026
…en PR branch Until #2 merges and the 19.0 wheel publishes, pip-install attachment_queue from the open migration PR branch via whool. Must be reverted before this PR is filed upstream to OCA.
dnplkndll
added a commit
that referenced
this pull request
May 20, 2026
* Manifest version → 19.0.1.0.0 (T07). * Delete migrations/18.0.1.0.0/ — pre-migrate script no longer applies in 19.0 (T08). * odoo.osv.expression → odoo.fields.Domain: import + the one expression.AND([d, ...]) call in run_task_import_scheduler rewritten as variadic Domain.AND(d, ...). * tracking_disable=True added to SyncCommon.setUpClass test context (covers test_export, test_import via inheritance). * README.rst + static/description/index.html regenerated from readme/ fragments. CI dep-chain note: attachment_synchronize depends on attachment_queue, which is not yet on OCA/server-tools 19.0 (it's in #2, our fork PR awaiting upstream). Until that lands, `test with Odoo` / `test with OCB` will fail at the install step ("No matching distribution found for odoo-addon-attachment_queue==19.0.*"). The migration code itself is complete and reviewable; CI will go green automatically once attachment_queue lands on OCA/19.0. Signed-off-by: Don Kendall <dkendall@ledoweb.com>
dnplkndll
added a commit
that referenced
this pull request
May 20, 2026
…en PR branch Until #2 merges and the 19.0 wheel publishes, pip-install attachment_queue from the open migration PR branch via whool. Must be reverted before this PR is filed upstream to OCA.
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
attachment_queuefrom 18.0 to 19.0. Follows the OCA migration guide.What changed
19.0.1.0.0; deletedmigrations/18.0.1.0.0/.self._cr→self.env.crinattachment_queue.pySQL exec (deprecated in 19).views/attachment_queue_view.xml):<field>re-ordered to all precede<filter>/<separator>/<group>(19 RelaxNG enforces type-grouped children).<group expand="0" string="Group By">wrapper removed — group-by filters live at the top level of<search>in 19.data/mail_template.xml):${object.x}→{{object.x}}(Mako removed in 19; Jinja only)._(...)→self.env._(...)intests/test_models.py.odoo_test_helper.FakeModelLoader→ nativeodoo.orm.model_classes.add_to_registry(instance setUp → setUpClass + addClassCleanup).odoo-test-helperis incompatible with 19 (MetaModel.module_to_modelswas renamed/privatized).Test results —
--test-tags=/attachment_queueon a local 19.0 doodba stack6 of 8 tests pass cleanly. Two known follow-ups for maintainer review:
test_run_fails_rollback— fails with emptymail.mail.email_to. The template's{{object.failure_emails}}renders to""when the fake-model override of_get_failure_emailsshould return"test@test.com". Looks like a mail-template-render-env behavior change in 19 — the renderer may use the baseattachment.queueclass rather than the registry-augmented fake class. Maintainer call: patch the test to mock the compute directly, or accept the renderer behavior change.tearDownClasserror —addClassCleanup(cls.registry.__delitem__, "attachment.queue")orphansattachment.queue.reschedule.attachment_ids(M2m → "attachment.queue") on the subsequent_setup_models__pass. The native 19add_to_registryteardown doesn't cascade to dependents the wayodoo-test-helperdid. Needs a more careful cleanup sequence (re-setup after delete, or explicit handling of the dependent).Suggested for the maintainers @florian-dacosta @sebastienbeau — both reachable via the existing
attachment_queuereviewer pool. The substantive 19.0 work (view validation, Mako→Jinja, native test-registry API) is in this PR; both remaining failures are tests-only and tractable with one of you in the loop.