Skip to content

Commit 3df24d2

Browse files
committed
[MIG] document_page: migration Browse Wiki Content to 17.0
1 parent 59f773f commit 3df24d2

6 files changed

+41
-53
lines changed

document_page/__manifest__.py

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
"assets": {
3333
"web.assets_backend": [
3434
"document_page/static/src/scss/document_page.scss",
35+
"document_page/static/src/js/document_page_kanban_controller.js",
36+
"document_page/static/src/js/document_page_kanban_view.js",
3537
],
3638
},
3739
}

document_page/static/src/js/document_page_kanban.js

-26
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/** @odoo-module */
2+
import {KanbanController} from "@web/views/kanban/kanban_controller";
3+
4+
export class DocumentPageKanbanController extends KanbanController {
5+
/**
6+
* @param {Object} record
7+
*/
8+
async openRecord(record) {
9+
const element = document.querySelector(
10+
`.o_kanban_record[data-id="${record.id}"] .o_document_page_kanban_boxes a`
11+
);
12+
13+
if (this.props.resModel === "document.page" && element) {
14+
element.click();
15+
} else {
16+
await super.openRecord(record);
17+
}
18+
}
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/** @odoo-module */
2+
import {registry} from "@web/core/registry";
3+
import {kanbanView} from "@web/views/kanban/kanban_view";
4+
import {DocumentPageKanbanController} from "./document_page_kanban_controller";
5+
6+
export const documentPageKanbanView = {
7+
...kanbanView,
8+
Controller: DocumentPageKanbanController,
9+
};
10+
11+
registry.category("views").add("document_page_kanban_view", documentPageKanbanView);

document_page/views/document_page.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
/>
4646
<field name="active" invisible="1" />
4747
<field name="type" invisible="1" />
48-
<field name="image" widget="image" class="oe_avatar" />
48+
<field name="image" widget="image" class="oe_avatar" style="z-index:1"/>
4949
<div class="oe_title">
5050
<h1>
5151
<field name="name" placeholder="Name" />

document_page/views/document_page_category.xml

+8-26
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
<field name="name">document.page.browse.kanban</field>
9898
<field name="model">document.page</field>
9999
<field name="arch" type="xml">
100-
<kanban>
100+
<kanban js_class="document_page_kanban_view">
101101
<field name="id" />
102102
<field name="name" />
103103
<field name="display_name" />
@@ -152,35 +152,13 @@
152152
<img
153153
t-att-src="kanban_image('document.page', 'image', record.parent_id.raw_value)"
154154
t-att-alt="record.parent_id.display_name"
155-
width="24"
156-
height="24"
155+
style="margin-right:5px; width:24px; height:24px;"
157156
/>
158157
<field name="parent_id" />
159158
</small>
160159
</div>
161160
</div>
162-
<div
163-
class="o_dropdown_kanban dropdown"
164-
groups="base.group_user"
165-
>
166-
<a
167-
role="button"
168-
class="dropdown-toggle o-no-caret btn"
169-
data-toggle="dropdown"
170-
data-display="static"
171-
href="#"
172-
aria-label="Dropdown menu"
173-
title="Dropdown menu"
174-
>
175-
<span class="fa fa-ellipsis-v" />
176-
</a>
177-
<div class="dropdown-menu" role="menu">
178-
<ul
179-
class="oe_kanban_colorpicker"
180-
data-field="color"
181-
/>
182-
</div>
183-
</div>
161+
184162
<div class="o_kanban_record_body">
185163
<div class="o_kanban_tags_section">
186164
</div>
@@ -219,6 +197,10 @@
219197
</div>
220198
</div>
221199
</t>
200+
201+
<t t-name="kanban-menu">
202+
<ul class="oe_kanban_colorpicker" data-field="color" />
203+
</t>
222204
</templates>
223205
</kanban>
224206
</field>
@@ -302,7 +284,7 @@
302284
/>
303285
<menuitem
304286
id="menu_browse_content"
305-
parent="knowledge.menu_document_root"
287+
parent="document_knowledge.menu_document_root"
306288
name="Browse Wiki Content"
307289
action="action_browse_top_content"
308290
sequence="5"

0 commit comments

Comments
 (0)