[19.0][MIG] dms_field_auto_classification: Migration to 19.0#14
Open
dnplkndll wants to merge 8 commits into
Open
[19.0][MIG] dms_field_auto_classification: Migration to 19.0#14dnplkndll wants to merge 8 commits into
dnplkndll wants to merge 8 commits into
Conversation
f95252f to
12ae1d1
Compare
142abe0 to
5169526
Compare
12ae1d1 to
1a226ca
Compare
5169526 to
a4d18ed
Compare
1a226ca to
6f4d9ea
Compare
a4d18ed to
5130c4f
Compare
6f4d9ea to
278216f
Compare
5130c4f to
edf28e2
Compare
278216f to
50748de
Compare
edf28e2 to
7ab9a28
Compare
- Rewrote setUpClass to create fixtures inline (storage, dms.access.group,
dms.field.template, template root directory) — OCA CI runs without demo
data so env.ref("dms_field.field_template_partner") would fail
… dms_list) - Add hero_chips named slot to dms.field.template form view - Replace custom file-node preview in dms_list renderer with FilePreviewPane from base DMS (download, open-form, share, extra-action registry) - Directory-node panel retained; file branch now leverages shared preview infrastructure
50748de to
87e079f
Compare
7ab9a28 to
ead2a41
Compare
Wizard: - _compute_directory_id: use item.parent_id instead of self.parent_id inside the recordset loop — self is the full wizard set, not the current item; caused silent wrong-company + empty pattern results on multi-record batches - _compute_file_id: replace removed fields.first(files) with files[:1] dms_field _search_parents (Odoo 19 SQL composable API): - _where_calc(), _apply_ir_rules(), and tuple query.from_clause/where_clause were removed in 19.0; rewrote using _search(bypass_access=True) + SQL() composable objects — was an AttributeError on every jstree load dms_field tests: - res.groups field renamed users → user_ids in 19.0 - fields.first() removed — replaced with recordset[:1] - test_creation_process_*_with_parent: template root dir as parent_directory_id caused infinite recursion in _create_child_directories; use independent dir - new tests: test_search_parents_count, limit_offset, excludes_children dms / dms_field UX (code-review): - dms_directory.scss / portal.scss: DRY bucket colour maps with @each loops; portal map was declared after first use (silent no-op in SCSS) - portal.xml: replace broken icon_url img with initials chip (data-bucket hash) - file_preview_pane.xml: ARIA attrs (role, aria-label, aria-busy, aria-live) - file_kanban_record.esm.js: .o_kanban_dms_card--previewing selection ring - dms_list widget: structured directory preview card (chip + 4-stat grid); Bootstrap CSS variable tokens for dark-mode; fix #aaaa invalid hex
d4965b9 to
242e4c4
Compare
…cy with its 19.0 migration head
1d6a8eb to
3ebd721
Compare
86799dc to
bdf3c9e
Compare
3ebd721 to
066837a
Compare
bdf3c9e to
55ee2fc
Compare
066837a to
38b4bec
Compare
55ee2fc to
95587c3
Compare
…th 19.0 migration head
95587c3 to
9367d2b
Compare
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 dms_field_auto_classification from 18.0 to 19.0. See the OCA migration guide.
Depends on ledoent/dms#13 (dms_field).
Non-mechanical adaptations worth flagging
Tests: all
env.ref()demo-data references replaced with inline fixtures — OCA CI runs without demo data.setUpClassnow createsdms.storage,dms.access.group,dms.field.template(+ manualcreate_dms_directory()),dms.classification.template, anddms.classification.template.detaildirectly._compute_directory_idrecordset-iteration bug fixed —wizard_dms_classification.pyoverride usedself.parent_idinside the compute loop, whereselfis the full recordset. On multi-record batches this picks up the wrong wizard, causing the company filter and_get_directory_from_patterncall to silently return nothing. Fixed toitem.parent_id._search_parentsported to Odoo 19 SQL composable API — The 18.0 implementation called_where_calc(),_apply_ir_rules(), and accessedquery.from_clause/query.where_clauseas tuples — all removed in 19.0. Rewrote to useself._search(domain, bypass_access=True)(returns aQuery) withSQLcomposable objects throughout. This was a runtimeAttributeErroron every jstree load in the field widget.Tests fixed for 3 Odoo 19 API changes surfaced by the clean-DB run:
res.groups.usersrenamed touser_idsfields.first()removed — replaced withrecordset[:1]test_creation_process_*_with_parent: using the template's own root dir asparent_directory_idcaused infinite recursion in_create_child_directories. Fixed by creating an independent parent dir per test.New
_search_parentstest coverage:test_search_parents_count,test_search_parents_limit_offset,test_search_parents_excludes_children— exercise the rewritten SQL path (count, pagination, parent-exclusion clause).dmsmodule UX housekeeping (code-review findings):dms_directory.scss/portal.scss: extracted$dms-dir-bucketsmap; replaced 8×2 inline colour rules with@eachloops. Portal map was declared after first use — silent no-op in SCSS.portal.xml: replaced brokenicon_urlimg with initials chip matching the backend kanban.file_preview_pane.xml: added ARIA attributes (role,aria-label,aria-busy,aria-live).file_kanban_record.esm.js: add.o_kanban_dms_card--previewingselection ring on click.Directory preview card (item 5 verification)
Partner form → DMS tab → select a directory node → preview card renders: