mirror of
https://github.com/OCA/knowledge.git
synced 2025-07-26 02:18:40 -06:00
[MIG] document_page: migration Browse Wiki Content to 17.0
This commit is contained in:
parent
59f773ffed
commit
443b2cfcac
@ -51,11 +51,11 @@ Usage
|
||||
|
||||
To use this module, you need to:
|
||||
|
||||
- Go to Knowledge menu
|
||||
- Click on Categories to create the document's category you need with
|
||||
the template
|
||||
- Click on Pages to create pages and select the previous category to
|
||||
use the template
|
||||
- Go to Knowledge menu
|
||||
- Click on Categories to create the document's category you need with
|
||||
the template
|
||||
- Click on Pages to create pages and select the previous category to use
|
||||
the template
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
@ -78,32 +78,32 @@ Authors
|
||||
Contributors
|
||||
------------
|
||||
|
||||
- Gervais Naoussi <gervaisnaoussi@gmail.com>
|
||||
- Maxime Chambreuil <mchambreuil@ursainfosystems.com>
|
||||
- Iván Todorovich <ivan.todorovich@gmail.com>
|
||||
- Jose Maria Alzaga <jose.alzaga@aselcis.com>
|
||||
- Lois Rilo <lois.rilo@forgeflow.com>
|
||||
- Simone Orsi <simone.orsi@camptocamp.com>
|
||||
- `Tecnativa <https://www.tecnativa.com>`__:
|
||||
- Gervais Naoussi <gervaisnaoussi@gmail.com>
|
||||
- Maxime Chambreuil <mchambreuil@ursainfosystems.com>
|
||||
- Iván Todorovich <ivan.todorovich@gmail.com>
|
||||
- Jose Maria Alzaga <jose.alzaga@aselcis.com>
|
||||
- Lois Rilo <lois.rilo@forgeflow.com>
|
||||
- Simone Orsi <simone.orsi@camptocamp.com>
|
||||
- `Tecnativa <https://www.tecnativa.com>`__:
|
||||
|
||||
- Ernesto Tejeda
|
||||
- Víctor Martínez
|
||||
- Ernesto Tejeda
|
||||
- Víctor Martínez
|
||||
|
||||
Trobz
|
||||
|
||||
- Dung Tran <dungtd@trobz.com>
|
||||
- `Sygel <https://www.sygel.es>`__:
|
||||
- Dung Tran <dungtd@trobz.com>
|
||||
- `Sygel <https://www.sygel.es>`__:
|
||||
|
||||
- Ángel García de la Chica Herrera
|
||||
- Ángel García de la Chica Herrera
|
||||
|
||||
Other credits
|
||||
-------------
|
||||
|
||||
The development of this module has been financially supported by:
|
||||
|
||||
- Odoo SA <http://www.odoo.com>
|
||||
- Savoir-faire Linux <http://www.savoirfairelinux.com>
|
||||
- Camptocamp
|
||||
- Odoo SA <http://www.odoo.com>
|
||||
- Savoir-faire Linux <http://www.savoirfairelinux.com>
|
||||
- Camptocamp
|
||||
|
||||
Maintainers
|
||||
-----------
|
||||
|
@ -32,6 +32,8 @@
|
||||
"assets": {
|
||||
"web.assets_backend": [
|
||||
"document_page/static/src/scss/document_page.scss",
|
||||
"document_page/static/src/js/document_page_kanban_controller.esm.js",
|
||||
"document_page/static/src/js/document_page_kanban_view.esm.js",
|
||||
],
|
||||
},
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ class DocumentPage(models.Model):
|
||||
compute="_compute_backend_url",
|
||||
)
|
||||
|
||||
image = fields.Binary("Image", attachment=True)
|
||||
image = fields.Binary(attachment=True)
|
||||
color = fields.Integer(string="Color Index")
|
||||
|
||||
@api.depends("menu_id", "parent_id.menu_id")
|
||||
|
@ -8,10 +8,11 @@
|
||||
|
||||
/*
|
||||
:Author: David Goodger (goodger@python.org)
|
||||
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
|
||||
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
|
||||
:Copyright: This stylesheet has been placed in the public domain.
|
||||
|
||||
Default cascading style sheet for the HTML output of Docutils.
|
||||
Despite the name, some widely supported CSS2 features are used.
|
||||
|
||||
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
|
||||
customize this style sheet.
|
||||
@ -274,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
||||
margin-left: 2em ;
|
||||
margin-right: 2em }
|
||||
|
||||
pre.code .ln { color: grey; } /* line numbers */
|
||||
pre.code .ln { color: gray; } /* line numbers */
|
||||
pre.code, code { background-color: #eeeeee }
|
||||
pre.code .comment, code .comment { color: #5C6576 }
|
||||
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
||||
@ -300,7 +301,7 @@ span.option {
|
||||
span.pre {
|
||||
white-space: pre }
|
||||
|
||||
span.problematic {
|
||||
span.problematic, pre.problematic {
|
||||
color: red }
|
||||
|
||||
span.section-subtitle {
|
||||
@ -402,8 +403,8 @@ addons list.</p>
|
||||
<li>Go to Knowledge menu</li>
|
||||
<li>Click on Categories to create the document’s category you need with
|
||||
the template</li>
|
||||
<li>Click on Pages to create pages and select the previous category to
|
||||
use the template</li>
|
||||
<li>Click on Pages to create pages and select the previous category to use
|
||||
the template</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="bug-tracker">
|
||||
@ -458,7 +459,9 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
|
||||
<div class="section" id="maintainers">
|
||||
<h2><a class="toc-backref" href="#toc-entry-9">Maintainers</a></h2>
|
||||
<p>This module is maintained by the OCA.</p>
|
||||
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
|
||||
<a class="reference external image-reference" href="https://odoo-community.org">
|
||||
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
|
||||
</a>
|
||||
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
|
||||
mission is to support the collaborative development of Odoo features and
|
||||
promote its widespread use.</p>
|
||||
|
@ -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);
|
@ -45,7 +45,12 @@
|
||||
/>
|
||||
<field name="active" invisible="1" />
|
||||
<field name="type" invisible="1" />
|
||||
<field name="image" widget="image" class="oe_avatar" />
|
||||
<field
|
||||
name="image"
|
||||
widget="image"
|
||||
class="oe_avatar"
|
||||
style="z-index:1"
|
||||
/>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
<field name="name" placeholder="Name" />
|
||||
|
@ -97,7 +97,7 @@
|
||||
<field name="name">document.page.browse.kanban</field>
|
||||
<field name="model">document.page</field>
|
||||
<field name="arch" type="xml">
|
||||
<kanban>
|
||||
<kanban js_class="document_page_kanban_view">
|
||||
<field name="id" />
|
||||
<field name="name" />
|
||||
<field name="display_name" />
|
||||
@ -152,35 +152,13 @@
|
||||
<img
|
||||
t-att-src="kanban_image('document.page', 'image', record.parent_id.raw_value)"
|
||||
t-att-alt="record.parent_id.display_name"
|
||||
width="24"
|
||||
height="24"
|
||||
style="margin-right:5px; width:24px; height:24px;"
|
||||
/>
|
||||
<field name="parent_id" />
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="o_dropdown_kanban dropdown"
|
||||
groups="base.group_user"
|
||||
>
|
||||
<a
|
||||
role="button"
|
||||
class="dropdown-toggle o-no-caret btn"
|
||||
data-toggle="dropdown"
|
||||
data-display="static"
|
||||
href="#"
|
||||
aria-label="Dropdown menu"
|
||||
title="Dropdown menu"
|
||||
>
|
||||
<span class="fa fa-ellipsis-v" />
|
||||
</a>
|
||||
<div class="dropdown-menu" role="menu">
|
||||
<ul
|
||||
class="oe_kanban_colorpicker"
|
||||
data-field="color"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="o_kanban_record_body">
|
||||
<div class="o_kanban_tags_section">
|
||||
</div>
|
||||
@ -219,6 +197,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
<t t-name="kanban-menu">
|
||||
<ul class="oe_kanban_colorpicker" data-field="color" />
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
</field>
|
||||
@ -302,7 +284,7 @@
|
||||
/>
|
||||
<menuitem
|
||||
id="menu_browse_content"
|
||||
parent="knowledge.menu_document_root"
|
||||
parent="document_knowledge.menu_document_root"
|
||||
name="Browse Wiki Content"
|
||||
action="action_browse_top_content"
|
||||
sequence="5"
|
||||
|
Loading…
Reference in New Issue
Block a user