From 33f8486f80a0d3bbce5bdd69281b054b1e11d8fc Mon Sep 17 00:00:00 2001 From: Lois Rilo Date: Thu, 28 Feb 2019 12:59:30 +0100 Subject: [PATCH] [11.0][ADD] document_page_project --- document_page_project/README.rst | 81 ++++ document_page_project/__init__.py | 1 + document_page_project/__manifest__.py | 24 + document_page_project/models/__init__.py | 2 + document_page_project/models/document_page.py | 14 + .../models/project_project.py | 23 + document_page_project/readme/CONTRIBUTORS.rst | 3 + document_page_project/readme/DESCRIPTION.rst | 1 + document_page_project/readme/USAGE.rst | 2 + .../static/description/index.html | 430 ++++++++++++++++++ .../views/document_page_views.xml | 35 ++ .../views/project_project_views.xml | 21 + 12 files changed, 637 insertions(+) create mode 100644 document_page_project/README.rst create mode 100644 document_page_project/__init__.py create mode 100644 document_page_project/__manifest__.py create mode 100644 document_page_project/models/__init__.py create mode 100644 document_page_project/models/document_page.py create mode 100644 document_page_project/models/project_project.py create mode 100644 document_page_project/readme/CONTRIBUTORS.rst create mode 100644 document_page_project/readme/DESCRIPTION.rst create mode 100644 document_page_project/readme/USAGE.rst create mode 100644 document_page_project/static/description/index.html create mode 100644 document_page_project/views/document_page_views.xml create mode 100644 document_page_project/views/project_project_views.xml diff --git a/document_page_project/README.rst b/document_page_project/README.rst new file mode 100644 index 00000000000..b13efd8c36a --- /dev/null +++ b/document_page_project/README.rst @@ -0,0 +1,81 @@ +============ +Project Wiki +============ + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/11.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-11-0/knowledge-11-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/11.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allow to link document pages to projects. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +* Go to to a project and click on "Wiki Pages" to see linked documents or to + create new ones. + +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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Efient + +Contributors +~~~~~~~~~~~~ + +* `Eficent `_: + + * Lois Rilo + +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 `_ 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/__init__.py b/document_page_project/__init__.py new file mode 100644 index 00000000000..0650744f6bc --- /dev/null +++ b/document_page_project/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/document_page_project/__manifest__.py b/document_page_project/__manifest__.py new file mode 100644 index 00000000000..a363a5e14b1 --- /dev/null +++ b/document_page_project/__manifest__.py @@ -0,0 +1,24 @@ +# Copyright 2019 Eficent Business and IT Consulting Services S.L. +# (http://www.eficent.com) - Lois Rilo +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +{ + 'name': 'Project Wiki', + 'description': 'This module links document pages to projects', + 'version': '11.0.1.0.0', + "development_status": "Beta", + 'category': 'Project', + 'author': 'Efient, ' + 'Odoo Community Association (OCA)', + 'website': 'https://github.com/OCA/project', + 'license': 'AGPL-3', + 'depends': [ + 'project', + 'document_page', + ], + 'data': [ + 'views/document_page_views.xml', + 'views/project_project_views.xml', + ], + 'installable': True, +} diff --git a/document_page_project/models/__init__.py b/document_page_project/models/__init__.py new file mode 100644 index 00000000000..0cf1057da59 --- /dev/null +++ b/document_page_project/models/__init__.py @@ -0,0 +1,2 @@ +from . import project_project +from . import document_page diff --git a/document_page_project/models/document_page.py b/document_page_project/models/document_page.py new file mode 100644 index 00000000000..dd55e43d37b --- /dev/null +++ b/document_page_project/models/document_page.py @@ -0,0 +1,14 @@ +# Copyright 2019 Eficent Business and IT Consulting Services S.L. +# (http://www.eficent.com) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class DocumentPage(models.Model): + _inherit = 'document.page' + + project_id = fields.Many2one( + string='Project', + comodel_name='project.project', + ) diff --git a/document_page_project/models/project_project.py b/document_page_project/models/project_project.py new file mode 100644 index 00000000000..2f7d2111dd6 --- /dev/null +++ b/document_page_project/models/project_project.py @@ -0,0 +1,23 @@ +# Copyright 2019 Eficent Business and IT Consulting Services S.L. +# (http://www.eficent.com) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo import api, fields, models + + +class ProjectProject(models.Model): + _inherit = 'project.project' + + document_page_ids = fields.One2many( + string='Wiki', + comodel_name='document.page', + inverse_name='project_id' + ) + document_page_count = fields.Integer( + compute='_compute_document_page_count', + ) + + @api.multi + def _compute_document_page_count(self): + for rec in self: + rec.document_page_count = len(rec.document_page_ids) diff --git a/document_page_project/readme/CONTRIBUTORS.rst b/document_page_project/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000000..edfe84680e8 --- /dev/null +++ b/document_page_project/readme/CONTRIBUTORS.rst @@ -0,0 +1,3 @@ +* `Eficent `_: + + * Lois Rilo diff --git a/document_page_project/readme/DESCRIPTION.rst b/document_page_project/readme/DESCRIPTION.rst new file mode 100644 index 00000000000..f1cd784b379 --- /dev/null +++ b/document_page_project/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module allow to link document pages to projects. diff --git a/document_page_project/readme/USAGE.rst b/document_page_project/readme/USAGE.rst new file mode 100644 index 00000000000..b8ea0ace4be --- /dev/null +++ b/document_page_project/readme/USAGE.rst @@ -0,0 +1,2 @@ +* Go to to a project and click on "Wiki Pages" to see linked documents or to + create new ones. diff --git a/document_page_project/static/description/index.html b/document_page_project/static/description/index.html new file mode 100644 index 00000000000..3d35517b221 --- /dev/null +++ b/document_page_project/static/description/index.html @@ -0,0 +1,430 @@ + + + + + + +Project Wiki + + + +
+

Project Wiki

+ + +

Beta 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

+ +
+

Usage

+
    +
  • Go to to a project and click on “Wiki Pages” to see linked documents or to +create new ones.
  • +
+
+
+

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.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Efient
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

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

+
+
+
+ + diff --git a/document_page_project/views/document_page_views.xml b/document_page_project/views/document_page_views.xml new file mode 100644 index 00000000000..19d0d23fb82 --- /dev/null +++ b/document_page_project/views/document_page_views.xml @@ -0,0 +1,35 @@ + + + + + document.page.form - document_page_project + document.page + + + + + + + + + + Project Wiki + document.page + [('type','=','content'), ('project_id', '=', active_id)] + { + 'default_type': 'content', + 'default_project_id': active_id} + form + tree,form + + + +

+ Click to create a new web page. +

+
+
+ +
diff --git a/document_page_project/views/project_project_views.xml b/document_page_project/views/project_project_views.xml new file mode 100644 index 00000000000..033eaa6c639 --- /dev/null +++ b/document_page_project/views/project_project_views.xml @@ -0,0 +1,21 @@ + + + + + project.project + + + + +
+ + + + Wiki Pages +
+
+
+
+
+ +