mirror of
https://github.com/OCA/knowledge.git
synced 2025-12-20 04:12:18 -06:00
[MIG] document_page: migration Browse Wiki Content to 17.0
This commit is contained in:
committed by
Justine Doutreloux
parent
d0df693b95
commit
3482986272
@@ -1,26 +0,0 @@
|
||||
odoo.define("document_page.update_kanban", function (require) {
|
||||
"use strict";
|
||||
|
||||
var KanbanRecord = require("web.KanbanRecord");
|
||||
|
||||
KanbanRecord.include({
|
||||
// --------------------------------------------------------------------------
|
||||
// Private
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* @override
|
||||
* @private
|
||||
*/
|
||||
_openRecord: function () {
|
||||
if (
|
||||
this.modelName === "document.page" &&
|
||||
this.$(".o_document_page_kanban_boxes a").length
|
||||
) {
|
||||
this.$(".o_document_page_kanban_boxes a").first().click();
|
||||
} else {
|
||||
this._super.apply(this, arguments);
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
/** @odoo-module **/
|
||||
import {KanbanController} from "@web/views/kanban/kanban_controller";
|
||||
|
||||
export class DocumentPageKanbanController extends KanbanController {
|
||||
/**
|
||||
* @param {Object} record
|
||||
*/
|
||||
async openRecord(record) {
|
||||
const element = document.querySelector(
|
||||
`.o_kanban_record[data-id="${record.id}"] .o_document_page_kanban_boxes a`
|
||||
);
|
||||
|
||||
if (this.props.resModel === "document.page" && element) {
|
||||
element.click();
|
||||
} else {
|
||||
await super.openRecord(record);
|
||||
}
|
||||
}
|
||||
}
|
||||
11
document_page/static/src/js/document_page_kanban_view.esm.js
Normal file
11
document_page/static/src/js/document_page_kanban_view.esm.js
Normal file
@@ -0,0 +1,11 @@
|
||||
/** @odoo-module **/
|
||||
import {registry} from "@web/core/registry";
|
||||
import {kanbanView} from "@web/views/kanban/kanban_view";
|
||||
import {DocumentPageKanbanController} from "./document_page_kanban_controller.esm";
|
||||
|
||||
export const documentPageKanbanView = {
|
||||
...kanbanView,
|
||||
Controller: DocumentPageKanbanController,
|
||||
};
|
||||
|
||||
registry.category("views").add("document_page_kanban_view", documentPageKanbanView);
|
||||
Reference in New Issue
Block a user