Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions document_page/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ Trobz

* Ángel García de la Chica Herrera

* `NuoBiT Solutions SL <https://www.nuobit.com>`__:

* Deniz Gallo <dgallo@nuobit.com>

Other credits
~~~~~~~~~~~~~

Expand Down
13 changes: 13 additions & 0 deletions document_page/models/document_page.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright 2026 NuoBiT Solutions SL - Deniz Gallo <dgallo@nuobit.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import _, api, fields, models
Expand Down Expand Up @@ -198,3 +199,15 @@ def copy(self, default=None):
draft_summary=_("summary"),
)
return super(DocumentPage, self).copy(default=default)

def action_view_children(self):
self.ensure_one()
action = self.env["ir.actions.act_window"]._for_xml_id(
"document_page.action_browse_all_content"
)
action["context"] = {
"default_type": "content",
"search_default_parent_id": [self.id],
}
action["display_name"] = self.name
return action
4 changes: 4 additions & 0 deletions document_page/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ Trobz
* `Sygel <https://www.sygel.es>`_:

* Ángel García de la Chica Herrera

* `NuoBiT Solutions SL <https://www.nuobit.com>`__:

* Deniz Gallo <dgallo@nuobit.com>
15 changes: 11 additions & 4 deletions document_page/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -274,7 +275,7 @@
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 }
Expand All @@ -300,7 +301,7 @@
span.pre {
white-space: pre }

span.problematic {
span.problematic, pre.problematic {
color: red }

span.section-subtitle {
Expand Down Expand Up @@ -441,6 +442,10 @@ <h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
<li>Ángel García de la Chica Herrera</li>
</ul>
</li>
<li><a class="reference external" href="https://www.nuobit.com">NuoBiT Solutions SL</a>:<ul>
<li>Deniz Gallo &lt;<a class="reference external" href="mailto:dgallo&#64;nuobit.com">dgallo&#64;nuobit.com</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="other-credits">
Expand All @@ -455,7 +460,9 @@ <h2><a class="toc-backref" href="#toc-entry-8">Other credits</a></h2>
<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>
Expand Down
13 changes: 13 additions & 0 deletions document_page/tests/test_document_page.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Copyright 2026 NuoBiT Solutions SL - Deniz Gallo <dgallo@nuobit.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.tests import common

Expand Down Expand Up @@ -67,3 +68,15 @@ def test_page_copy(self):
self.assertEqual(page_copy.content, page.content)
self.assertEqual(page_copy.draft_name, "1.0")
self.assertEqual(page_copy.draft_summary, "summary")

def test_category_view_children(self):
action = self.category1.action_view_children()
self.assertEqual(action["xml_id"], "document_page.action_browse_all_content")
self.assertEqual(action["display_name"], self.category1.name)
self.assertEqual(
action["context"],
{
"default_type": "content",
"search_default_parent_id": [self.category1.id],
},
)
6 changes: 4 additions & 2 deletions document_page/views/document_page_category.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- Copyright 2026 NuoBiT Solutions SL - Deniz Gallo <dgallo@nuobit.com>
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<odoo>
<!-- Category Views -->
<record id="view_category_form" model="ir.ui.view">
Expand Down Expand Up @@ -216,8 +218,8 @@
>
<a
class="o_document_page_kanban_box"
name="%(action_browse_all_content)d"
type="action"
name="action_view_children"
type="object"
>
</a>
</div>
Expand Down
Loading