From 54e54679574f51178da6851366371660ef795153 Mon Sep 17 00:00:00 2001 From: Michael Telahun Date: Mon, 15 Nov 2021 04:09:54 +0300 Subject: [PATCH] [MIG] document_page_project: Migration to 14.0 --- document_page_project/README.rst | 10 +++--- .../i18n/document_page_project.pot | 20 ++++++++++- .../static/description/index.html | 6 ++-- document_page_project/tests/__init__.py | 2 ++ .../tests/test_project_project.py | 36 +++++++++++++++++++ 5 files changed, 65 insertions(+), 9 deletions(-) create mode 100644 document_page_project/tests/__init__.py create mode 100644 document_page_project/tests/test_project_project.py diff --git a/document_page_project/README.rst b/document_page_project/README.rst index 7387e2a3..ba7706ee 100644 --- a/document_page_project/README.rst +++ b/document_page_project/README.rst @@ -14,13 +14,13 @@ Document Page Project :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/13.0/document_page_project + :target: https://github.com/OCA/knowledge/tree/14.0/document_page_project :alt: OCA/knowledge .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/knowledge-13-0/knowledge-13-0-document_page_project + :target: https://translation.odoo-community.org/projects/knowledge-14-0/knowledge-14-0-document_page_project :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/118/13.0 + :target: https://runbot.odoo-community.org/runbot/118/14.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -44,7 +44,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -76,6 +76,6 @@ 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 `_ project on GitHub. +This module is part of the `OCA/knowledge `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/document_page_project/i18n/document_page_project.pot b/document_page_project/i18n/document_page_project.pot index 2d9a91e6..483d3c4b 100644 --- a/document_page_project/i18n/document_page_project.pot +++ b/document_page_project/i18n/document_page_project.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 13.0\n" +"Project-Id-Version: Odoo Server 14.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" @@ -23,6 +23,12 @@ msgstr "" msgid "Click to create a new web page." msgstr "" +#. module: document_page_project +#: model:ir.model.fields,field_description:document_page_project.field_document_page__display_name +#: model:ir.model.fields,field_description:document_page_project.field_project_project__display_name +msgid "Display Name" +msgstr "" + #. module: document_page_project #: model:ir.model,name:document_page_project.model_document_page msgid "Document Page" @@ -33,6 +39,18 @@ msgstr "" msgid "Document Page Count" msgstr "" +#. module: document_page_project +#: model:ir.model.fields,field_description:document_page_project.field_document_page__id +#: model:ir.model.fields,field_description:document_page_project.field_project_project__id +msgid "ID" +msgstr "" + +#. module: document_page_project +#: model:ir.model.fields,field_description:document_page_project.field_document_page____last_update +#: model:ir.model.fields,field_description:document_page_project.field_project_project____last_update +msgid "Last Modified on" +msgstr "" + #. module: document_page_project #: model:ir.model,name:document_page_project.model_project_project #: model:ir.model.fields,field_description:document_page_project.field_document_page__project_id diff --git a/document_page_project/static/description/index.html b/document_page_project/static/description/index.html index 1115549e..47016d3c 100644 --- a/document_page_project/static/description/index.html +++ b/document_page_project/static/description/index.html @@ -367,7 +367,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Production/Stable License: AGPL-3 OCA/knowledge Translate me on Weblate Try me on Runbot

+

Production/Stable License: AGPL-3 OCA/knowledge Translate me on Weblate Try me on Runbot

This module allow to link document pages to projects.

Table of contents

@@ -394,7 +394,7 @@ create new ones.

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -feedback.

+feedback.

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

@@ -421,7 +421,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome

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 project on GitHub.

+

This module is part of the OCA/knowledge project on GitHub.

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

diff --git a/document_page_project/tests/__init__.py b/document_page_project/tests/__init__.py new file mode 100644 index 00000000..bfe3dbf8 --- /dev/null +++ b/document_page_project/tests/__init__.py @@ -0,0 +1,2 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from . import test_project_project diff --git a/document_page_project/tests/test_project_project.py b/document_page_project/tests/test_project_project.py new file mode 100644 index 00000000..8624756f --- /dev/null +++ b/document_page_project/tests/test_project_project.py @@ -0,0 +1,36 @@ +# Copyright (C) 2021 TREVI Software +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.tests import common + + +class TestProjectProject(common.SavepointCase): + @classmethod + def setUpClass(cls): + super(TestProjectProject, cls).setUpClass() + + cls.Page = cls.env["document.page"] + cls.Project = cls.env["project.project"] + cls.default_page = cls.Page.create({"name": "My page"}) + + def test_page_count(self): + + proj = self.Project.create({"name": "Proj A"}) + + self.assertEqual( + proj.document_page_count, 0, "Initial page count should be zero" + ) + + self.default_page.project_id = proj + proj._compute_document_page_count() + + self.assertEqual( + proj.document_page_count, + 1, + "After attaching project to document the page count should be one", + ) + self.assertIn( + self.default_page, + proj.document_page_ids, + "The page should be in the list of document pages for project", + )