Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
7a571c4
create document_page_approval module
cloutierjo Apr 16, 2013
00272c9
[IMP] Documentation
Jul 19, 2013
ccafd2c
Set document_page_approval as unported
Jul 18, 2014
2dca0a2
start porting
gborelli Nov 11, 2014
4491fd7
Comment workflow that cause the error
llacroix Dec 29, 2014
2e82230
[IMP] - Changed string from email template.
Jul 23, 2015
74133cc
[MIG] document_page_approval: Migration to 9.0
naousse Oct 28, 2015
90c7b1d
[MIG] document_page_approval: Migration to 10.0
LeartS Dec 22, 2016
711d72b
[FIX] View
max3903 Apr 13, 2018
b8b5f35
[IMP][10.0][document_page_approval] Change Requests and workflow impr…
ivantodorovich Apr 13, 2018
3538c01
[MIG] document_page_approval: Migration to 11.0
Jun 14, 2018
cd4a3c9
[FIX+IMP] document_page_approval:
ivantodorovich Apr 20, 2018
a195f89
[FIX] pylint/javascript-lint
MiquelRForgeFlow Mar 11, 2019
f149a1f
[FIX] document_page_aproval: Modify in records rules
nicomacr May 31, 2019
71622e8
[MIG] document_page_approval: Migration to v12
Aug 23, 2019
6ff7db5
[IMP] document_page_approval: black, isort
Jul 4, 2020
66a1ec7
[IMP] document_page_approval: black, isort, prettier + squashed admin…
jeroen-vet Sep 22, 2020
ca695c8
[FIX] document_page_approval: Avoid W7940 (dangerous-view-replace-wo-…
pedrobaeza Mar 30, 2022
6112cad
[MIG] document_page_approval: Migration to 15.0
victoralmau Jul 26, 2022
91e85e8
[16.0][MIG] document_page_approval: Migration to 16.0
FernandoRomera Dec 13, 2022
d88baa8
Translated using Weblate (Italian)
mymage Dec 28, 2022
07e65b3
Translated using Weblate (Croatian)
badbole Feb 15, 2023
b3eca1b
Translated using Weblate (Italian)
francesco-ooops Apr 7, 2023
dacbb81
Translated using Weblate (Italian)
mymage Apr 10, 2023
5eb4b97
[FIX] document_page_approval: Change mail template expressions
victoralmau Apr 19, 2023
2e25462
Translated using Weblate (Italian)
francesco-ooops Apr 26, 2023
1162fe0
Translated using Weblate (Italian)
mymage May 18, 2023
90aa709
Translated using Weblate (Spanish)
luis-ron Jun 6, 2023
dfd6ac2
Translated using Weblate (Italian)
francesco-ooops Jun 6, 2023
30b02f9
Translated using Weblate (Italian)
mymage Jun 22, 2023
dd83d0a
Translated using Weblate (Spanish)
Ivorra78 Aug 4, 2023
b0b86a2
Translated using Weblate (Italian)
mymage Sep 4, 2023
0c9c971
Translated using Weblate (Spanish)
Ivorra78 Sep 5, 2023
7cc6238
Translated using Weblate (Portuguese)
peterromao Feb 28, 2024
b206798
Translated using Weblate (Italian)
mymage Apr 2, 2024
6388b07
[FIX] document_page_approval: Add correct followers in history pages
victoralmau Feb 23, 2021
c468c67
Translated using Weblate (Spanish)
berisoft-arg May 15, 2024
fd754df
Translated using Weblate (Swedish)
jakobkrabbe Jun 19, 2024
6918d5f
[IMP] document_page_approval: pre-commit auto fixes
victoralmau Nov 12, 2024
acaf5dd
[MIG] document_page_approval: Migration to 17.0
EdgarRetes Oct 2, 2024
6b92a97
[MIG] document_page_approval: Finish migration
victoralmau Nov 12, 2024
591b30b
[UPD] Update document_page_approval.pot
Nov 13, 2024
a0c624c
[BOT] post-merge updates
OCA-git-bot Nov 13, 2024
d5319ea
Update translation files
weblate Nov 13, 2024
719ea13
[UPD] Update document_page_approval.pot
Jan 24, 2025
cda31d9
Update translation files
weblate Jan 24, 2025
5fdbba1
Translated using Weblate (Italian)
mymage Jan 25, 2025
e38ebf1
Translated using Weblate (Spanish)
victoralmau Feb 3, 2025
44dbe84
[IMP] document_page_approval: pre-commit auto fixes
BhaveshHeliconia Feb 17, 2025
6742af0
[FIX] document_page_approval: Add Change Request Manager rule
victoralmau Mar 17, 2025
4385cd1
[MIG] document_page_approval: Migration to 18.0
BhaveshHeliconia Mar 28, 2025
90c1c4a
[UPD] Update document_page_approval.pot
Mar 28, 2025
c62e9aa
[BOT] post-merge updates
OCA-git-bot Mar 28, 2025
3355f4e
[UPD] Update document_page_approval.pot
Jun 21, 2025
5e57484
Update translation files
weblate Jun 21, 2025
073db42
Translated using Weblate (Italian)
mymage Jun 23, 2025
0d16036
[UPD] Update document_page_approval.pot
Jul 17, 2025
71495e5
Update translation files
weblate Jul 17, 2025
cd70f58
Translated using Weblate (Swedish)
jakobkrabbe Sep 18, 2025
1fba1ca
[FIX] document_page_approval: Fix tests to use real html
etobella Dec 17, 2025
b3dcc27
[BOT] post-merge updates
OCA-git-bot Dec 17, 2025
77eac9b
[FIX] document_page_approval: Avoid errors when creating a page histo…
victoralmau Mar 2, 2026
b4b160f
[BOT] post-merge updates
OCA-git-bot Mar 3, 2026
c9ede51
Translated using Weblate (Spanish)
Ed-Spain Apr 19, 2026
b010f6c
Translated using Weblate (Slovenian)
sysadminmatmoz Jun 7, 2026
4780bfb
Translated using Weblate (French)
ypapouin Jun 9, 2026
4dfa2d9
Translated using Weblate (Slovenian)
sysadminmatmoz Jun 13, 2026
06ecfd9
[MIG] document_page_approval: Migration to 19.0
max3903 Jun 19, 2026
6e694fd
[UPD] Update document_page_approval.pot
max3903 Jun 19, 2026
7f045a2
[FIX] document_page_approval: fix CI (test with Odoo)
max3903 Jun 19, 2026
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
134 changes: 134 additions & 0 deletions document_page_approval/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

======================
Document Page Approval
======================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:076e3494c42033cf34cf3d9a7a92ea7f0d7982d04738360bec6ff9604ee1b357
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fknowledge-lightgray.png?logo=github
:target: https://github.com/OCA/knowledge/tree/19.0/document_page_approval
:alt: OCA/knowledge
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/knowledge-19-0/knowledge-19-0-document_page_approval
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/knowledge&target_branch=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module adds an approval workflow for document page changes in the
Knowledge app. When a category requires approval, edits create change
requests that approvers must review before the approved content is shown
to readers.

**Table of contents**

.. contents::
:local:

Configuration
=============

To configure this module, you need to:

1. Set a valid email address on the company settings.
2. Go to **Knowledge > Configuration > Categories**.
3. Create or open a category and enable **Require approval**.
4. Select an **Approver group**. Users in that group must also belong to
the **Approver** security group and have valid email addresses.

Usage
=====

To use this module, you need to:

1. Go to **Knowledge > Pages** and create or edit a page under a
category that requires approval.
2. Saving changes creates a **Change Request** in draft or pending
approval state.
3. Send the request for review. Approvers receive an email with a link
to the change request.
4. An approver opens **Knowledge > Change Requests**, reviews the
request, and approves or cancels it.
5. Readers see the last approved version of the page content.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/knowledge/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/knowledge/issues/new?body=module:%20document_page_approval%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Savoir-faire Linux

Contributors
------------

- Odoo SA <info@odoo.com>

- Savoir-faire Linux <support@savoirfairelinux.com>

- Gervais Naoussi <gervaisnaoussi@gmail.com>

- Maxime Chambreuil <maxime.chambreuil@graymatterlogic.com>

- Iván Todorovich <ivan.todorovich@gmail.com>

- `Tecnativa <https://www.tecnativa.com>`__:

- Victor M.M. Torres
- Víctor Martínez

- `Guadaltech <https://www.guadaltech.es>`__:

- Fernando La Chica <fernando.lachica@guadaltech.es>

- `Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>`__

- Bhavesh Heliconia

- `Gray Matter Logic <https://www.graymatterlogic.com>`__:

- Maxime Chambreuil <maxime.chambreuil@graymatterlogic.com>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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.

This module is part of the `OCA/knowledge <https://github.com/OCA/knowledge/tree/19.0/document_page_approval>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
5 changes: 5 additions & 0 deletions document_page_approval/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
from .hooks import post_init_hook, uninstall_hook
25 changes: 25 additions & 0 deletions document_page_approval/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Document Page Approval",
"version": "19.0.1.0.0",
"author": "Savoir-faire Linux, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/knowledge",
"license": "AGPL-3",
"category": "Knowledge Management",
"depends": ["document_page", "mail"],
"data": [
"data/email_template.xml",
"views/document_page_approval.xml",
"security/document_page_security.xml",
],
"images": [
"images/category.png",
"images/page_history_list.png",
"images/page_history.png",
],
"post_init_hook": "post_init_hook",
"uninstall_hook": "uninstall_hook",
"installable": True,
}
44 changes: 44 additions & 0 deletions document_page_approval/data/email_template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!-- If user wants to make upgrade-proof customizations to email templates, he should edit ir.model.data and check noupdate himself -->
<record id="email_template_new_draft_need_approval" model="mail.template">
<field name="name">Automated new draft need approval Notification Mail</field>
<field
name="email_from"
>{{object.create_uid.company_id.email or 'noreply@localhost.com'}}</field>
<field
name="subject"
>New version of {{object.display_name}} needs your approval</field>
<field name="model_id" ref="model_document_page_history" />
<field name="auto_delete" eval="True" />
<field name="lang">{{object.create_uid.partner_id.lang}}</field>
<field name="body_html" type="html">
<p>Hello,</p>
<p><t t-out="object.create_uid.name" /> submited a new Change Request for <b
t-out="object.page_id.name"
/> and it needs your approval.</p>
<h1>
<a t-att-href="object.page_url" t-out="object.display_name" />
</h1>
<p>
<b>Modified by:</b>
<t t-out="object.create_uid.name" />
</p>
<p>
<b>Date:</b>
<t t-out="object.create_date" />
</p>
<t t-if="object.summary">
<h3>Summary</h3>
<p t-out="object.summary" />
</t>
<h3>Diff</h3>
<div style="overflow-x:scroll; font-size:0.85em; margin-bottom:2em;">
<t t-out="object.diff" />
</div>
<p>Have a great day.</p>
<br />
<p>Odoo</p>
</field>
</record>
</odoo>
25 changes: 25 additions & 0 deletions document_page_approval/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2018 Ivan Todorovich (<ivan.todorovich@gmail.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import logging

_logger = logging.getLogger(__name__)


def post_init_hook(env): # pragma: no cover
# Set all pre-existing pages history to approved
_logger.info("Setting history to approved.")
env.cr.execute(
"""
UPDATE document_page_history
SET state='approved',
approved_uid=create_uid,
approved_date=create_date
WHERE state IS NULL OR state = 'draft'
"""
)


def uninstall_hook(env): # pragma: no cover
# Remove unapproved pages
_logger.info("Deleting unapproved Change Requests.")
env.cr.execute("DELETE FROM document_page_history WHERE state != 'approved'")
Loading
Loading