Skip to content

Commit c603804

Browse files
committed
[IMP] dms: OWL UX refinements (phase 2 preview)
Follow-up to OCA#475 phase 1 (the minimal-viable 19.0 [MIG]). Opens on the ledoent fork against the phase 1 branch so reviewers can preview the delta on top of OCA#475 before it lands. - **Breadcrumb modernisation**: replace `path_owl.xml`'s inline-style `<a oe_form_uri>` + `<span style="display: inline">` pattern with Odoo 19's `<ol class="o_breadcrumb breadcrumb"><li class="breadcrumb-item">` Bootstrap idiom. Final segment uses `class="breadcrumb-item active"` with `aria-current="page"` per Bootstrap a11y guidance. - **Restore `filter_domain` on `dms_category.xml`** search view — `filter_domain="['|', ('name', 'ilike', self), ('parent_id', 'child_of', raw_value)]"` was removed in OCA#475 and re-introduces the 18.0 UX of filtering by parent category subtree when typing a parent's name. The bare 19.0 default `ilike` on name lost that behaviour. (Tag search left as default — 18.0's filter was equivalent to 19.0's default for that field.) Originally this PR also rewired the kanban `buttonTemplate` from `dms.KanbanButtons` to the orphan `dms.FileKanbanView.Buttons` template, but that template uses invalid OWL inheritance syntax (`<div role="toolbar" position="inside">` instead of `<xpath ...>`) AND references controller hooks (`uploadFileInputRef`, `onFileInputChange`) that don't exist on the controller. Reverted; phase 1's classic `dms.KanbanButtons` template stays in place (it's now self-contained without `t-inherit` since 19.0's `web.KanbanView.Buttons` is empty). Deferred to a later round: JS dead-code audit (inconclusive — core 19.0 `LinkPreview` has no native `imageUrl` getter, so our patches may still be load-bearing), coverage closure, and a proper kanban UX modernisation once `dms.FileKanbanView.Buttons` is fixed or replaced. Signed-off-by: Daniel Kendall <dkendall@ledoweb.com>
1 parent ba067b0 commit c603804

2 files changed

Lines changed: 25 additions & 20 deletions

File tree

dms/static/src/js/fields/path_json/path_owl.xml

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,27 @@
66
<templates xml:space="preserve" id="template">
77
<t t-name="dms.DmsPathField">
88
<t t-set="path_length" t-value="data.length - 1" />
9-
<t t-foreach="data" t-as="elem" t-key="elem_index" style="display: inline">
10-
<t t-if="elem_index !== path_length">
11-
<span style="display: inline" t-if="elem_index !== 0">/</span>
12-
<a
13-
class="oe_form_uri"
14-
data-model="dms.directory"
15-
t-att-data-id="elem.id"
16-
href="#"
17-
t-on-click.prevent="(ev) => this._onNodeClicked(ev)"
18-
>
19-
<t t-esc="elem.name" />
20-
</a>
9+
<ol class="o_breadcrumb breadcrumb mb-0">
10+
<t t-foreach="data" t-as="elem" t-key="elem_index">
11+
<t t-if="elem_index !== path_length">
12+
<li class="breadcrumb-item">
13+
<a
14+
class="oe_form_uri"
15+
data-model="dms.directory"
16+
t-att-data-id="elem.id"
17+
href="#"
18+
t-on-click.prevent="(ev) => this._onNodeClicked(ev)"
19+
>
20+
<t t-esc="elem.name" />
21+
</a>
22+
</li>
23+
</t>
24+
<t t-else="">
25+
<li class="breadcrumb-item active" aria-current="page">
26+
<t t-esc="elem.name" />
27+
</li>
28+
</t>
2129
</t>
22-
<t t-else="">
23-
<span style="display: inline">/</span>
24-
<span style="display: inline">
25-
<t t-esc="elem.name" />
26-
</span>
27-
</t>
28-
</t>
30+
</ol>
2931
</t>
3032
</templates>

dms/views/dms_category.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
<field name="model">dms.category</field>
1313
<field name="arch" type="xml">
1414
<search string="Categories">
15-
<field name="name" />
15+
<field
16+
name="name"
17+
filter_domain="['|', ('name', 'ilike', self), ('parent_id', 'child_of', raw_value)]"
18+
/>
1619
<filter
1720
string="All"
1821
name="all"

0 commit comments

Comments
 (0)