Skip to content
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

[15.0][MIG] document_page_portal: migration to 15.0 #484

Open
wants to merge 40 commits into
base: 15.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
0f883d8
[ADD] document_page_portal
marcelsavegnago Feb 15, 2020
dae015f
[UPD] Update document_page_portal.pot
oca-travis Jan 8, 2021
4663f5b
[UPD] README.rst
OCA-git-bot Jan 8, 2021
2f38c4c
[IMP] document_page_portal: black, isort, prettier
marcelsavegnago Feb 28, 2021
11686e6
[MIG] document_page_portal: Migration to 13.0
marcelsavegnago Feb 28, 2021
dc18654
[UPD] Update document_page_portal.pot
oca-travis Mar 16, 2021
db97467
[UPD] README.rst
OCA-git-bot Mar 16, 2021
bbc16da
Update translation files
oca-transbot Mar 16, 2021
42161c8
Added translation using Weblate (Italian)
mymage Jun 23, 2023
dfc37f8
Translated using Weblate (Italian)
mymage Jun 23, 2023
c5b025a
[UPD] README.rst
OCA-git-bot Sep 3, 2023
285cda5
[IMP] document_page_portal: pre-commit auto fixes
May 13, 2024
ae4e3ca
[FIX]document_page_portal: changed phantom_js to tour
May 14, 2024
52eaf49
[FIX]document_page_portal: changed tour to start_tour
May 14, 2024
bd61e00
[FIX]document_page_portal: added req file
May 20, 2024
e2d43b1
[REM]removed requirements file
May 21, 2024
570dbb4
[FIX]document_page_portal: changed to browser_js
May 21, 2024
f736d46
[FIX]document_page_portal: added back req file
May 21, 2024
9b75f2e
[FIX]document_page_portal: added back req file
May 21, 2024
cf58eb1
[FIX]document_page_portal: added external_dependency in manifest
May 21, 2024
6a53ce7
[FIX]document_page_portal: added method to a controller
May 22, 2024
01ab4fa
[FIX] document_page_portal: renamed tour
May 22, 2024
4959442
[FIX]document_page_portal: added dependency
May 23, 2024
c0b02bb
[FIX]document_page_portal: added test-requirements file
May 24, 2024
54fa891
[FIX]document_page_portal:changed the name in test requirements
May 24, 2024
00366ba
Changed to browser_js
Jun 28, 2024
100cc20
Changed to browser_js to second function
Jun 28, 2024
56a092a
Changed to browser_js to second function
Jun 28, 2024
3593225
testing commented out method
Jul 5, 2024
3597dc6
retried
Jul 7, 2024
ff31a88
fixed testing req
Jul 7, 2024
862db41
made small adjustement to tour
Jul 7, 2024
d2e740b
made small adjustement to tour
Jul 7, 2024
45d2a5d
[FIX]doument_page_portal: added test cases
Aug 13, 2024
070d39c
[FIX]doument_page_portal: added test cases
Aug 13, 2024
27b3afc
[FIX]doument_page_portal: added test cases
Aug 13, 2024
f1e95e4
[FIX]doument_page_portal: added test cases
Aug 13, 2024
8fbfa74
[FIX]doument_page_portal: added test cases
Aug 13, 2024
9e38a69
[FIX]doument_page_portal: added test cases
Aug 13, 2024
561f892
[FIX] document_page_portal: added tests for controller
Aug 13, 2024
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
103 changes: 103 additions & 0 deletions document_page_portal/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
====================
Document Page Portal
====================

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

.. |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/15.0/document_page_portal
:alt: OCA/knowledge
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/knowledge-15-0/knowledge-15-0-document_page_portal
: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=15.0
:alt: Try me on Runboat

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

This module allows documents to be made available on the portal.

**Table of contents**

.. contents::
:local:

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

No configuration required.

Usage
=====

* Add a user as a follower of the document or configure the document as public so that it is visible through the user portal.

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_portal%0Aversion:%2015.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
~~~~~~~

* Escodoo

Contributors
~~~~~~~~~~~~

* `Escodoo <https://www.escodoo.com.br>`_:

* Marcel Savegnago <[email protected]>

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

The development of this module has been financially supported by:

* Escodoo <https://www.escodoo.com.br>

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.

.. |maintainer-marcelsavegnago| image:: https://github.com/marcelsavegnago.png?size=40px
:target: https://github.com/marcelsavegnago
:alt: marcelsavegnago

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-marcelsavegnago|

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

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions document_page_portal/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import controllers
from . import models
28 changes: 28 additions & 0 deletions document_page_portal/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright (C) 2020 - TODAY, Marcel Savegnago - Escodoo).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).


{
"name": "Document Page Portal",
"summary": """
This module enables document page portal""",
"version": "15.0.1.0.0",
"category": "Knowledge Management",
"author": "Escodoo, Odoo Community Association (OCA)",
"maintainers": ["marcelsavegnago"],
"images": ["static/description/banner.png"],
"website": "https://github.com/OCA/knowledge",
"license": "AGPL-3",
"depends": ["base", "portal", "document_page", "web_tour"],
"data": [
"views/document_page.xml",
"security/document_page_portal_security.xml",
"security/ir.model.access.csv",
"views/document_page_portal_templates.xml",
],
"assets": {
"web.assets_tests": [
"document_page_portal/static/src/js/document_page_portal_tour.js"
],
},
}
1 change: 1 addition & 0 deletions document_page_portal/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import portal
37 changes: 37 additions & 0 deletions document_page_portal/controllers/portal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from odoo.tests.common import HttpCase


class TestPortalController(HttpCase):
def setUp(self):
super(TestPortalController, self).setUp()
self.document_page_model = self.env["document.page"]
self.portal_controller = self.env["ir.http"].get(
"portal.my.knowledge.document.pages"
)

def test_prepare_portal_layout_values(self):
self.document_page_model.create({"name": "Test Page 1", "type": "content"})
response = self.portal_controller()._prepare_portal_layout_values()
self.assertIn("document_page_count", response)
self.assertEqual(response["document_page_count"], 1)

def test_get_archive_groups(self):
self.document_page_model.create({"name": "Test Page 1", "type": "content"})
domain = [("type", "=", "content")]
groups = self.portal_controller()._get_archive_groups("document.page", domain)
self.assertTrue(groups)
self.assertEqual(groups[0]["name"], "Test Page 1")

def test_portal_my_knowledge_document_pages(self):
self.document_page_model.create({"name": "Test Page 1", "type": "content"})
response = self.url_open("/my/knowledge/documents/")
self.assertEqual(response.status_code, 200)
self.assertIn(b"Test Page 1", response.data)

def test_document_pages_followup(self):
document_page = self.document_page_model.create(
{"name": "Test Page 1", "type": "content"}
)
response = self.url_open(f"/knowledge/document/{document_page.id}")
self.assertEqual(response.status_code, 200)
self.assertIn(b"Test Page 1", response.data)
94 changes: 94 additions & 0 deletions document_page_portal/i18n/document_page_portal.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * document_page_portal
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: document_page_portal
#: model_terms:ir.ui.view,arch_db:document_page_portal.document_pages_followup
msgid "<em class=\"text-muted\"><small>No content</small></em>"
msgstr ""

#. module: document_page_portal
#: model_terms:ir.ui.view,arch_db:document_page_portal.document_pages_followup
msgid "<small class=\"text-right\">Category:</small>"
msgstr ""

#. module: document_page_portal
#: code:addons/document_page_portal/controllers/portal.py:0
#: model_terms:ir.ui.view,arch_db:document_page_portal.portal_my_knowledge_document_pages
#, python-format
msgid "Category"
msgstr ""

#. module: document_page_portal
#: model_terms:ir.ui.view,arch_db:document_page_portal.document_pages_followup
msgid "Current Category of this document"
msgstr ""

#. module: document_page_portal
#: model:ir.model,name:document_page_portal.model_document_page
msgid "Document Page"
msgstr ""

#. module: document_page_portal
#: model:ir.model.fields,help:document_page_portal.field_document_page__is_public
msgid ""
"If true it allows any user of the portal to have access to this document."
msgstr ""

#. module: document_page_portal
#: model_terms:ir.ui.view,arch_db:document_page_portal.portal_my_home_Knowledge_document_page
#: model_terms:ir.ui.view,arch_db:document_page_portal.portal_my_home_menu_Knowledge
#: model_terms:ir.ui.view,arch_db:document_page_portal.portal_my_knowledge_document_pages
msgid "Knowledge Documents"
msgstr ""

#. module: document_page_portal
#: code:addons/document_page_portal/controllers/portal.py:0
#: model_terms:ir.ui.view,arch_db:document_page_portal.portal_my_knowledge_document_pages
#, python-format
msgid "Name"
msgstr ""

#. module: document_page_portal
#: code:addons/document_page_portal/controllers/portal.py:0
#, python-format
msgid "Newest"
msgstr ""

#. module: document_page_portal
#: model:ir.model.fields,field_description:document_page_portal.field_document_page__is_public
msgid "Public Page"
msgstr ""

#. module: document_page_portal
#: model_terms:ir.ui.view,arch_db:document_page_portal.portal_my_knowledge_document_pages
msgid "Ref"
msgstr ""

#. module: document_page_portal
#: code:addons/document_page_portal/controllers/portal.py:0
#, python-format
msgid "Search <span class=\"nolabel\"> (in Content)</span>"
msgstr ""

#. module: document_page_portal
#: code:addons/document_page_portal/controllers/portal.py:0
#, python-format
msgid "Search in All"
msgstr ""

#. module: document_page_portal
#: model_terms:ir.ui.view,arch_db:document_page_portal.portal_my_knowledge_document_pages
msgid "There are currently no Knowledge Document for your account."
msgstr ""
98 changes: 98 additions & 0 deletions document_page_portal/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * document_page_portal
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-06-23 10:10+0000\n"
"Last-Translator: mymage <[email protected]>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"

#. module: document_page_portal
#: model_terms:ir.ui.view,arch_db:document_page_portal.document_pages_followup
msgid "<em class=\"text-muted\"><small>No content</small></em>"
msgstr "<em class=\"text-muted\"><small>Nessun contenuto</small></em>"

#. module: document_page_portal
#: model_terms:ir.ui.view,arch_db:document_page_portal.document_pages_followup
msgid "<small class=\"text-right\">Category:</small>"
msgstr "<small class=\"text-right\">Categoria:</small>"

#. module: document_page_portal
#: code:addons/document_page_portal/controllers/portal.py:0
#: model_terms:ir.ui.view,arch_db:document_page_portal.portal_my_knowledge_document_pages
#, python-format
msgid "Category"
msgstr "Categoria"

#. module: document_page_portal
#: model_terms:ir.ui.view,arch_db:document_page_portal.document_pages_followup
msgid "Current Category of this document"
msgstr "Categoria attuale di questo documento"

#. module: document_page_portal
#: model:ir.model,name:document_page_portal.model_document_page
msgid "Document Page"
msgstr "Pagina documento"

#. module: document_page_portal
#: model:ir.model.fields,help:document_page_portal.field_document_page__is_public
msgid ""
"If true it allows any user of the portal to have access to this document."
msgstr ""
"Se vera consente ad ogni utente del portale di accedere a questo documento."

#. module: document_page_portal
#: model_terms:ir.ui.view,arch_db:document_page_portal.portal_my_home_Knowledge_document_page
#: model_terms:ir.ui.view,arch_db:document_page_portal.portal_my_home_menu_Knowledge
#: model_terms:ir.ui.view,arch_db:document_page_portal.portal_my_knowledge_document_pages
msgid "Knowledge Documents"
msgstr "Documenti knowledge"

#. module: document_page_portal
#: code:addons/document_page_portal/controllers/portal.py:0
#: model_terms:ir.ui.view,arch_db:document_page_portal.portal_my_knowledge_document_pages
#, python-format
msgid "Name"
msgstr "Nome"

#. module: document_page_portal
#: code:addons/document_page_portal/controllers/portal.py:0
#, python-format
msgid "Newest"
msgstr "Il più recente"

#. module: document_page_portal
#: model:ir.model.fields,field_description:document_page_portal.field_document_page__is_public
msgid "Public Page"
msgstr "Pagina pubblica"

#. module: document_page_portal
#: model_terms:ir.ui.view,arch_db:document_page_portal.portal_my_knowledge_document_pages
msgid "Ref"
msgstr "Rif."

#. module: document_page_portal
#: code:addons/document_page_portal/controllers/portal.py:0
#, python-format
msgid "Search <span class=\"nolabel\"> (in Content)</span>"
msgstr "Cerca <span class=\"nolabel\"> (nel contenuto)</span>"

#. module: document_page_portal
#: code:addons/document_page_portal/controllers/portal.py:0
#, python-format
msgid "Search in All"
msgstr "Cercare fra tutti"

#. module: document_page_portal
#: model_terms:ir.ui.view,arch_db:document_page_portal.portal_my_knowledge_document_pages
msgid "There are currently no Knowledge Document for your account."
msgstr "Al momento non ci sono documenti knowledge per il tuo account."
Loading
Loading