Skip to content

Commit 31cdf2c

Browse files
committed
[MIG] document_page_access_group: Migration to 15.0
1 parent 8bbced0 commit 31cdf2c

6 files changed

Lines changed: 44 additions & 11 deletions

File tree

document_page_access_group/README.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Document Page Access Group
77
!! This file is generated by oca-gen-addon-readme !!
88
!! changes will be overwritten. !!
99
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10-
!! source digest: sha256:e7fc1c256036fc0d9e338952db19ce8abcc9cbb414c5264956fb932d6be80e12
10+
!! source digest: sha256:c21399e1330aae842cb6046755b0816a2ef30f70268aa70cdf38441c5fded1b2
1111
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1212
1313
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -17,13 +17,13 @@ Document Page Access Group
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/14.0/document_page_access_group
20+
:target: https://github.com/OCA/knowledge/tree/15.0/document_page_access_group
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-14-0/knowledge-14-0-document_page_access_group
23+
:target: https://translation.odoo-community.org/projects/knowledge-15-0/knowledge-15-0-document_page_access_group
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=14.0
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/knowledge&target_branch=15.0
2727
:alt: Try me on Runboat
2828

2929
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -55,7 +55,7 @@ Bug Tracker
5555
Bugs are tracked on `GitHub Issues <https://github.com/OCA/knowledge/issues>`_.
5656
In case of trouble, please check there if your issue has already been reported.
5757
If you spotted it first, help us to smash it by providing a detailed and welcomed
58-
`feedback <https://github.com/OCA/knowledge/issues/new?body=module:%20document_page_access_group%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
58+
`feedback <https://github.com/OCA/knowledge/issues/new?body=module:%20document_page_access_group%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
5959

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

@@ -71,6 +71,7 @@ Contributors
7171
~~~~~~~~~~~~
7272

7373
* Manuel Regidor <manuel.regidor@sygel.es>
74+
* Alberto Martínez <alberto.martinez@sygel.es>
7475

7576
Maintainers
7677
~~~~~~~~~~~
@@ -85,6 +86,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
8586
mission is to support the collaborative development of Odoo features and
8687
promote its widespread use.
8788

88-
This module is part of the `OCA/knowledge <https://github.com/OCA/knowledge/tree/14.0/document_page_access_group>`_ project on GitHub.
89+
This module is part of the `OCA/knowledge <https://github.com/OCA/knowledge/tree/15.0/document_page_access_group>`_ project on GitHub.
8990

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

document_page_access_group/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{
55
"name": "Document Page Access Group",
66
"summary": "Choose groups to access document pages",
7-
"version": "14.0.1.0.0",
7+
"version": "15.0.1.0.0",
88
"category": "Knowledge",
99
"website": "https://github.com/OCA/knowledge",
1010
"author": "Sygel, Odoo Community Association (OCA)",
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
* Manuel Regidor <manuel.regidor@sygel.es>
2+
* Alberto Martínez <alberto.martinez@sygel.es>

document_page_access_group/static/description/index.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,9 +367,9 @@ <h1 class="title">Document Page Access Group</h1>
367367
!! This file is generated by oca-gen-addon-readme !!
368368
!! changes will be overwritten. !!
369369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370-
!! source digest: sha256:e7fc1c256036fc0d9e338952db19ce8abcc9cbb414c5264956fb932d6be80e12
370+
!! source digest: sha256:c21399e1330aae842cb6046755b0816a2ef30f70268aa70cdf38441c5fded1b2
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/14.0/document_page_access_group"><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-14-0/knowledge-14-0-document_page_access_group"><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=14.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/15.0/document_page_access_group"><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-15-0/knowledge-15-0-document_page_access_group"><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=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373373
<p>This module allows to select which users groups have access to the
374374
document pages.</p>
375375
<p><strong>Table of contents</strong></p>
@@ -400,7 +400,7 @@ <h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
400400
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/knowledge/issues">GitHub Issues</a>.
401401
In case of trouble, please check there if your issue has already been reported.
402402
If you spotted it first, help us to smash it by providing a detailed and welcomed
403-
<a class="reference external" href="https://github.com/OCA/knowledge/issues/new?body=module:%20document_page_access_group%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
403+
<a class="reference external" href="https://github.com/OCA/knowledge/issues/new?body=module:%20document_page_access_group%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
404404
<p>Do not contact contributors directly about support or help with technical issues.</p>
405405
</div>
406406
<div class="section" id="credits">
@@ -415,6 +415,7 @@ <h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
415415
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
416416
<ul class="simple">
417417
<li>Manuel Regidor &lt;<a class="reference external" href="mailto:manuel.regidor&#64;sygel.es">manuel.regidor&#64;sygel.es</a>&gt;</li>
418+
<li>Alberto Martínez &lt;<a class="reference external" href="mailto:alberto.martinez&#64;sygel.es">alberto.martinez&#64;sygel.es</a>&gt;</li>
418419
</ul>
419420
</div>
420421
<div class="section" id="maintainers">
@@ -424,7 +425,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
424425
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
425426
mission is to support the collaborative development of Odoo features and
426427
promote its widespread use.</p>
427-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/knowledge/tree/14.0/document_page_access_group">OCA/knowledge</a> project on GitHub.</p>
428+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/knowledge/tree/15.0/document_page_access_group">OCA/knowledge</a> project on GitHub.</p>
428429
<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>
429430
</div>
430431
</div>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
2+
3+
from . import test_document_page_access_group
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
2+
from odoo.exceptions import UserError
3+
from odoo.tests import common
4+
5+
6+
class TestDocumentPageAccessGroup(common.TransactionCase):
7+
def setUp(self):
8+
super(TestDocumentPageAccessGroup, self).setUp()
9+
self.document_user_group = self.browse_ref("knowledge.group_document_user").id
10+
self.test_group = self.browse_ref("base.group_erp_manager").id
11+
self.user_id = self.env["res.users"].create(
12+
{
13+
"name": "user",
14+
"login": "user_login",
15+
"email": "user_email",
16+
"groups_id": [(4, self.document_user_group)],
17+
}
18+
)
19+
self.page = self.env["document.page"].create(
20+
{"name": "Page 1", "type": "content"}
21+
)
22+
23+
def test_page_access(self):
24+
self.assertIsNone(self.page.with_user(self.user_id).check_access_rule("read"))
25+
self.page.write({"groups_id": [(4, self.test_group)]})
26+
with self.assertRaises(UserError):
27+
self.page.with_user(self.user_id).check_access_rule("read")

0 commit comments

Comments
 (0)