Skip to content

Commit 72f8257

Browse files
[MIG] document_page_approval: Migration to 18.0
1 parent a53bc19 commit 72f8257

File tree

7 files changed

+212
-87
lines changed

7 files changed

+212
-87
lines changed

document_page_approval/README.rst

+19-15
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ Document Page Approval
1717
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1818
:alt: License: AGPL-3
1919
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fknowledge-lightgray.png?logo=github
20-
:target: https://github.com/OCA/knowledge/tree/17.0/document_page_approval
20+
:target: https://github.com/OCA/knowledge/tree/18.0/document_page_approval
2121
:alt: OCA/knowledge
2222
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23-
:target: https://translation.odoo-community.org/projects/knowledge-17-0/knowledge-17-0-document_page_approval
23+
:target: https://translation.odoo-community.org/projects/knowledge-18-0/knowledge-18-0-document_page_approval
2424
:alt: Translate me on Weblate
2525
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26-
:target: https://runboat.odoo-community.org/builds?repo=OCA/knowledge&target_branch=17.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/knowledge&target_branch=18.0
2727
:alt: Try me on Runboat
2828

2929
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -64,7 +64,7 @@ Bug Tracker
6464
Bugs are tracked on `GitHub Issues <https://github.com/OCA/knowledge/issues>`_.
6565
In case of trouble, please check there if your issue has already been reported.
6666
If you spotted it first, help us to smash it by providing a detailed and welcomed
67-
`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**>`_.
67+
`feedback <https://github.com/OCA/knowledge/issues/new?body=module:%20document_page_approval%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
6868

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

@@ -79,24 +79,28 @@ Authors
7979
Contributors
8080
------------
8181

82-
- Odoo SA <info@odoo.com>
82+
- Odoo SA <info@odoo.com>
8383

84-
- Savoir-faire Linux <support@savoirfairelinux.com>
84+
- Savoir-faire Linux <support@savoirfairelinux.com>
8585

86-
- Gervais Naoussi <gervaisnaoussi@gmail.com>
86+
- Gervais Naoussi <gervaisnaoussi@gmail.com>
8787

88-
- Maxime Chambreuil <mchambreuil@opensourceintegrators.com>
88+
- Maxime Chambreuil <mchambreuil@opensourceintegrators.com>
8989

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

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

94-
- Victor M.M. Torres
95-
- Víctor Martínez
94+
- Victor M.M. Torres
95+
- Víctor Martínez
9696

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

99-
- Fernando La Chica <fernando.lachica@guadaltech.es>
99+
- Fernando La Chica <fernando.lachica@guadaltech.es>
100+
101+
- `Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>`__
102+
103+
- Bhavesh Heliconia
100104

101105
Maintainers
102106
-----------
@@ -111,6 +115,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
111115
mission is to support the collaborative development of Odoo features and
112116
promote its widespread use.
113117

114-
This module is part of the `OCA/knowledge <https://github.com/OCA/knowledge/tree/17.0/document_page_approval>`_ project on GitHub.
118+
This module is part of the `OCA/knowledge <https://github.com/OCA/knowledge/tree/18.0/document_page_approval>`_ project on GitHub.
115119

116120
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

document_page_approval/__manifest__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
{
55
"name": "Document Page Approval",
6-
"version": "17.0.1.0.0",
6+
"version": "18.0.1.0.0",
77
"author": "Savoir-faire Linux, Odoo Community Association (OCA)",
88
"website": "https://github.com/OCA/knowledge",
99
"license": "AGPL-3",

document_page_approval/models/document_page_history.py

+15-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Copyright (C) 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>).
22
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
33

4+
import re
5+
46
from odoo import fields, models
57
from odoo.exceptions import UserError
68
from odoo.tools.translate import _
@@ -93,12 +95,14 @@ def action_approve(self):
9395
raise UserError(
9496
_(
9597
"You are not authorized to do this.\r\n"
96-
"Only approvers with these groups can approve this: "
97-
)
98-
% ", ".join(
99-
[g.display_name for g in rec.page_id.approver_group_ids]
98+
"Only approvers with these groups can approve this: {}"
99+
).format(
100+
", ".join(
101+
[g.display_name for g in rec.page_id.approver_group_ids]
102+
)
100103
)
101104
)
105+
102106
# Update state
103107
rec.write(
104108
{
@@ -156,14 +160,18 @@ def _compute_page_url(self):
156160
)
157161

158162
def _compute_diff(self):
159-
"""Shows a diff between this version and the previous version"""
163+
"""Shows a cleaned-up diff between this version and the previous version."""
160164
history = self.env["document.page.history"]
161165
for rec in self:
162166
domain = [("page_id", "=", rec.page_id.id), ("state", "=", "approved")]
163167
if rec.approved_date:
164168
domain.append(("approved_date", "<", rec.approved_date))
165169
prev = history.search(domain, limit=1, order="approved_date DESC")
166170
if prev:
167-
rec.diff = self._get_diff(prev.id, rec.id)
171+
raw_diff = self._get_diff(prev.id, rec.id)
168172
else:
169-
rec.diff = self._get_diff(False, rec.id)
173+
raw_diff = self._get_diff(False, rec.id)
174+
175+
cleaned_diff = re.sub(r'data-last-history-steps=".*?"', "", raw_diff)
176+
177+
rec.diff = cleaned_diff

document_page_approval/readme/CONTRIBUTORS.md

+2
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@
1616
- [Guadaltech](https://www.guadaltech.es):
1717

1818
- Fernando La Chica \<<fernando.lachica@guadaltech.es>\>
19+
- [Heliconia Solutions Pvt. Ltd.](https://www.heliconia.io)
20+
- Bhavesh Heliconia

document_page_approval/static/description/index.html

+8-3
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ <h1 class="title">Document Page Approval</h1>
369369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370370
!! source digest: sha256:4b3ef803acd19a66515436d838c979c63daecf130c34b3f628dd5d8ac8137d34
371371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/knowledge/tree/17.0/document_page_approval"><img alt="OCA/knowledge" src="https://img.shields.io/badge/github-OCA%2Fknowledge-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/knowledge-17-0/knowledge-17-0-document_page_approval"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/knowledge&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/knowledge/tree/18.0/document_page_approval"><img alt="OCA/knowledge" src="https://img.shields.io/badge/github-OCA%2Fknowledge-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/knowledge-18-0/knowledge-18-0-document_page_approval"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/knowledge&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373373
<p>This module adds a workflow to approve page modifications and show the
374374
approved version by default.</p>
375375
<p><strong>Table of contents</strong></p>
@@ -413,7 +413,7 @@ <h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
413413
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/knowledge/issues">GitHub Issues</a>.
414414
In case of trouble, please check there if your issue has already been reported.
415415
If you spotted it first, help us to smash it by providing a detailed and welcomed
416-
<a class="reference external" href="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**">feedback</a>.</p>
416+
<a class="reference external" href="https://github.com/OCA/knowledge/issues/new?body=module:%20document_page_approval%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
417417
<p>Do not contact contributors directly about support or help with technical issues.</p>
418418
</div>
419419
<div class="section" id="credits">
@@ -450,6 +450,11 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
450450
<li>Fernando La Chica &lt;<a class="reference external" href="mailto:fernando.lachica&#64;guadaltech.es">fernando.lachica&#64;guadaltech.es</a>&gt;</li>
451451
</ul>
452452
</li>
453+
<li><p class="first"><a class="reference external" href="https://www.heliconia.io">Heliconia Solutions Pvt. Ltd.</a></p>
454+
<ul class="simple">
455+
<li>Bhavesh Heliconia</li>
456+
</ul>
457+
</li>
453458
</ul>
454459
</div>
455460
<div class="section" id="maintainers">
@@ -461,7 +466,7 @@ <h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
461466
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
462467
mission is to support the collaborative development of Odoo features and
463468
promote its widespread use.</p>
464-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/knowledge/tree/17.0/document_page_approval">OCA/knowledge</a> project on GitHub.</p>
469+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/knowledge/tree/18.0/document_page_approval">OCA/knowledge</a> project on GitHub.</p>
465470
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
466471
</div>
467472
</div>

0 commit comments

Comments
 (0)