-
-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MIG][17.0] document_page_approval #498
Closed
Closed
Changes from all commits
Commits
Show all changes
63 commits
Select commit
Hold shift + click to select a range
bcea319
create document_page_approval module
cloutierjo 3ee4bf6
[IMP] Documentation
aaf0251
Set document_page_approval as unported
41d03b8
start porting
gborelli 08183ae
Comment workflow that cause the error
llacroix 757e077
[IMP] - Changed string from email template.
46cb817
[FIX] - document-page-approval: Fixes #60 url not valid when website …
82b0942
[MIG] document_page_approval: Migration to 9.0
naousse b7ff569
[MIG] document_page_approval: Migration to 10.0
LeartS 18baa07
[FIX] View
max3903 71a34dd
[IMP][10.0][document_page_approval] Change Requests and workflow impr…
ivantodorovich 5fdd373
[MIG] document_page_approval: Migration to 11.0
53800f8
[FIX+IMP] document_page_approval:
ivantodorovich b9ce469
[FIX] pylint/javascript-lint
MiquelRForgeFlow 8759586
[FIX] document_page_aproval: Modify in records rules
nicomacr 48d178e
[MIG] document_page_approval: Migration to v12
3e7f9c6
[IMP] document_page_approval: black, isort
872c04e
Migrate to 13.0 document_page_approval
c00d84d
[IMP] document_page_approval: black, isort, prettier + squashed admin…
jeroen-vet 5b925c1
[MIG] document_page_approval: Migration to 14.0
jeroen-vet b3438f3
[FIX] document_page_approval: Avoid W7940 (dangerous-view-replace-wo-…
pedrobaeza 94e5497
[MIG] document_page_approval: Migration to 15.0
victoralmau 3128936
[UPD] Update document_page_approval.pot
632eb77
[UPD] README.rst
OCA-git-bot 721246a
[16.0][MIG] document_page_approval: Migration to 16.0
FernandoRomera 405afc8
[UPD] Update document_page_approval.pot
0aa0d10
[UPD] README.rst
OCA-git-bot 86d8d44
Update translation files
weblate 6f4afbe
Translated using Weblate (Italian)
mymage 3d0159e
Translated using Weblate (Italian)
mymage e848393
Translated using Weblate (Croatian)
badbole f731e82
Translated using Weblate (Croatian)
badbole 8540a35
Translated using Weblate (Italian)
francesco-ooops 811c654
Translated using Weblate (Italian)
mymage 26d4478
[FIX] document_page_approval: Change mail template expressions
victoralmau 605f35a
[UPD] Update document_page_approval.pot
bd358ea
document_page_approval 16.0.1.1.0
OCA-git-bot 40b9c8a
Update translation files
weblate 921cc90
Translated using Weblate (Italian)
francesco-ooops a037339
Translated using Weblate (Italian)
francesco-ooops 3dd3238
[UPD] Update document_page_approval.pot
1573ab9
Update translation files
weblate b318cd8
Translated using Weblate (Italian)
mymage 4514792
Translated using Weblate (Spanish)
luis-ron f6445f2
Translated using Weblate (Italian)
francesco-ooops b3bac4c
Translated using Weblate (Italian)
mymage fe40b2c
Translated using Weblate (Spanish)
Ivorra78 dba1885
[UPD] Update document_page_approval.pot
a671bf4
[UPD] README.rst
OCA-git-bot 5360967
Update translation files
weblate 00f49dd
Translated using Weblate (Italian)
mymage 9bd51b6
Translated using Weblate (Spanish)
Ivorra78 36c87a2
[UPD] Update document_page_approval.pot
a05454f
Update translation files
weblate 4396bcb
Translated using Weblate (Portuguese)
peterromao 3bd9fbd
[UPD] Update document_page_approval.pot
1772b75
Update translation files
weblate ffe2e51
Translated using Weblate (Italian)
mymage 2f627e1
[FIX] document_page_approval: Add correct followers in history pages
victoralmau 4a06f4a
[BOT] post-merge updates
OCA-git-bot 0ea1636
Translated using Weblate (Spanish)
berisoft-arg cb0ad1b
Translated using Weblate (Swedish)
jakobkrabbe 81725ef
[MIG] document_page_approval: Migration to 17.0
EdgarRetes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
====================== | ||
Document Page Approval | ||
====================== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:eaa85b29d79372636ce9dda9fbf87f567e6702f38a57385384a168b28a517ff5 | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
||
.. |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/licence-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/17.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-17-0/knowledge-17-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=17.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
This module adds a workflow to approve page modifications and show the | ||
approved version by default. | ||
|
||
**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 > Categories. | ||
3. Create a new page category and set an approver group. Make sure users | ||
belonging to that group have valid email addresses. | ||
|
||
Usage | ||
===== | ||
|
||
To use this module, you need to: | ||
|
||
1. Go to Knowledge > Pages | ||
2. Create a new page and choose the previously created category. | ||
3. A notification is sent to the approvers group with a link to the page | ||
history to review. | ||
4. Depending on the review, the page history is approved or not. | ||
5. Users reading the page see the last approved version. | ||
|
||
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:%2017.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 <[email protected]> | ||
|
||
- Savoir-faire Linux <[email protected]> | ||
|
||
- Gervais Naoussi <[email protected]> | ||
|
||
- Maxime Chambreuil <[email protected]> | ||
|
||
- Iván Todorovich <[email protected]> | ||
|
||
- `Tecnativa <https://www.tecnativa.com>`__: | ||
|
||
- Victor M.M. Torres | ||
- Víctor Martínez | ||
|
||
- `Guadaltech <https://www.guadaltech.es>`__: | ||
|
||
- Fernando La Chica <[email protected]> | ||
|
||
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/17.0/document_page_approval>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# 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": "17.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", | ||
"security/ir.model.access.csv", | ||
], | ||
"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, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?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 '[email protected]'}}</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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Copyright 2018 Ivan Todorovich (<[email protected]>) | ||
# 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'") |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the
name_get()
method, but do NOT remove the_compute_display_name()
method. That's what is stated in the migration guidelines https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-17.0