From 214855e2dad314f2b3c5129cf0a57193ec86b196 Mon Sep 17 00:00:00 2001 From: AjmalCybro Date: Tue, 13 Feb 2024 15:10:27 +0530 Subject: [PATCH] Feb 13 [ADD] : Initial Commit 'print_knowledge_article' --- print_knowledge_article/README.rst | 47 ++ print_knowledge_article/__init__.py | 22 + print_knowledge_article/__manifest__.py | 45 ++ print_knowledge_article/doc/RELEASE_NOTES.md | 6 + print_knowledge_article/models/__init__.py | 22 + .../models/knowledge_article.py | 38 ++ .../print_knowledge_article_reports.xml | 11 + .../print_knowledge_article_templates.xml | 77 +++ .../static/description/assets/hero.gif | Bin 0 -> 127395 bytes .../static/description/assets/icons/check.png | Bin 0 -> 3676 bytes .../description/assets/icons/chevron.png | Bin 0 -> 310 bytes .../static/description/assets/icons/cogs.png | Bin 0 -> 1377 bytes .../description/assets/icons/consultation.png | Bin 0 -> 1458 bytes .../description/assets/icons/ecom-black.png | Bin 0 -> 576 bytes .../assets/icons/education-black.png | Bin 0 -> 733 bytes .../description/assets/icons/hotel-black.png | Bin 0 -> 911 bytes .../description/assets/icons/license.png | Bin 0 -> 1095 bytes .../description/assets/icons/lifebuoy.png | Bin 0 -> 1199 bytes .../assets/icons/manufacturing-black.png | Bin 0 -> 673 bytes .../description/assets/icons/pos-black.png | Bin 0 -> 878 bytes .../description/assets/icons/puzzle.png | Bin 0 -> 653 bytes .../assets/icons/restaurant-black.png | Bin 0 -> 905 bytes .../assets/icons/service-black.png | Bin 0 -> 839 bytes .../assets/icons/trading-black.png | Bin 0 -> 427 bytes .../description/assets/icons/training.png | Bin 0 -> 627 bytes .../description/assets/icons/update.png | Bin 0 -> 1225 bytes .../static/description/assets/icons/user.png | Bin 0 -> 988 bytes .../description/assets/icons/wrench.png | Bin 0 -> 1205 bytes .../description/assets/misc/categories.png | Bin 0 -> 1532 bytes .../description/assets/misc/check-box.png | Bin 0 -> 1118 bytes .../description/assets/misc/compass.png | Bin 0 -> 1931 bytes .../description/assets/misc/corporate.png | Bin 0 -> 1177 bytes .../assets/misc/customer-support.png | Bin 0 -> 2136 bytes .../description/assets/misc/cybrosys-logo.png | Bin 0 -> 4496 bytes .../description/assets/misc/features.png | Bin 0 -> 589 bytes .../static/description/assets/misc/logo.png | Bin 0 -> 3452 bytes .../description/assets/misc/pictures.png | Bin 0 -> 1692 bytes .../description/assets/misc/pie-chart.png | Bin 0 -> 2338 bytes .../description/assets/misc/right-arrow.png | Bin 0 -> 967 bytes .../static/description/assets/misc/star.png | Bin 0 -> 1642 bytes .../description/assets/misc/support.png | Bin 0 -> 3892 bytes .../description/assets/misc/whatsapp.png | Bin 0 -> 5097 bytes .../static/description/assets/modules/1.png | Bin 0 -> 83877 bytes .../static/description/assets/modules/2.png | Bin 0 -> 81842 bytes .../static/description/assets/modules/3.png | Bin 0 -> 81649 bytes .../static/description/assets/modules/4.png | Bin 0 -> 86176 bytes .../static/description/assets/modules/5.png | Bin 0 -> 81543 bytes .../static/description/assets/modules/6.png | Bin 0 -> 85741 bytes .../description/assets/screenshots/print1.png | Bin 0 -> 272366 bytes .../description/assets/screenshots/print2.png | Bin 0 -> 132580 bytes .../static/description/banner.png | Bin 0 -> 98751 bytes .../static/description/icon.png | Bin 0 -> 21647 bytes .../static/description/index.html | 597 ++++++++++++++++++ .../views/knowledge_article_views.xml | 22 + 54 files changed, 887 insertions(+) create mode 100755 print_knowledge_article/README.rst create mode 100644 print_knowledge_article/__init__.py create mode 100644 print_knowledge_article/__manifest__.py create mode 100644 print_knowledge_article/doc/RELEASE_NOTES.md create mode 100644 print_knowledge_article/models/__init__.py create mode 100644 print_knowledge_article/models/knowledge_article.py create mode 100644 print_knowledge_article/report/print_knowledge_article_reports.xml create mode 100644 print_knowledge_article/report/print_knowledge_article_templates.xml create mode 100644 print_knowledge_article/static/description/assets/hero.gif create mode 100644 print_knowledge_article/static/description/assets/icons/check.png create mode 100644 print_knowledge_article/static/description/assets/icons/chevron.png create mode 100644 print_knowledge_article/static/description/assets/icons/cogs.png create mode 100644 print_knowledge_article/static/description/assets/icons/consultation.png create mode 100644 print_knowledge_article/static/description/assets/icons/ecom-black.png create mode 100644 print_knowledge_article/static/description/assets/icons/education-black.png create mode 100644 print_knowledge_article/static/description/assets/icons/hotel-black.png create mode 100644 print_knowledge_article/static/description/assets/icons/license.png create mode 100644 print_knowledge_article/static/description/assets/icons/lifebuoy.png create mode 100644 print_knowledge_article/static/description/assets/icons/manufacturing-black.png create mode 100644 print_knowledge_article/static/description/assets/icons/pos-black.png create mode 100644 print_knowledge_article/static/description/assets/icons/puzzle.png create mode 100644 print_knowledge_article/static/description/assets/icons/restaurant-black.png create mode 100644 print_knowledge_article/static/description/assets/icons/service-black.png create mode 100644 print_knowledge_article/static/description/assets/icons/trading-black.png create mode 100644 print_knowledge_article/static/description/assets/icons/training.png create mode 100644 print_knowledge_article/static/description/assets/icons/update.png create mode 100644 print_knowledge_article/static/description/assets/icons/user.png create mode 100644 print_knowledge_article/static/description/assets/icons/wrench.png create mode 100644 print_knowledge_article/static/description/assets/misc/categories.png create mode 100644 print_knowledge_article/static/description/assets/misc/check-box.png create mode 100644 print_knowledge_article/static/description/assets/misc/compass.png create mode 100644 print_knowledge_article/static/description/assets/misc/corporate.png create mode 100644 print_knowledge_article/static/description/assets/misc/customer-support.png create mode 100644 print_knowledge_article/static/description/assets/misc/cybrosys-logo.png create mode 100644 print_knowledge_article/static/description/assets/misc/features.png create mode 100644 print_knowledge_article/static/description/assets/misc/logo.png create mode 100644 print_knowledge_article/static/description/assets/misc/pictures.png create mode 100644 print_knowledge_article/static/description/assets/misc/pie-chart.png create mode 100644 print_knowledge_article/static/description/assets/misc/right-arrow.png create mode 100644 print_knowledge_article/static/description/assets/misc/star.png create mode 100644 print_knowledge_article/static/description/assets/misc/support.png create mode 100644 print_knowledge_article/static/description/assets/misc/whatsapp.png create mode 100644 print_knowledge_article/static/description/assets/modules/1.png create mode 100644 print_knowledge_article/static/description/assets/modules/2.png create mode 100644 print_knowledge_article/static/description/assets/modules/3.png create mode 100644 print_knowledge_article/static/description/assets/modules/4.png create mode 100644 print_knowledge_article/static/description/assets/modules/5.png create mode 100644 print_knowledge_article/static/description/assets/modules/6.png create mode 100644 print_knowledge_article/static/description/assets/screenshots/print1.png create mode 100644 print_knowledge_article/static/description/assets/screenshots/print2.png create mode 100644 print_knowledge_article/static/description/banner.png create mode 100644 print_knowledge_article/static/description/icon.png create mode 100644 print_knowledge_article/static/description/index.html create mode 100644 print_knowledge_article/views/knowledge_article_views.xml diff --git a/print_knowledge_article/README.rst b/print_knowledge_article/README.rst new file mode 100755 index 000000000..02be42023 --- /dev/null +++ b/print_knowledge_article/README.rst @@ -0,0 +1,47 @@ +.. image:: https://img.shields.io/badge/license-OPL--1-red.svg + :target: https://www.odoo.com/documentation/16.0/legal/licenses.html#odoo-apps + :alt: License: OPL-1 + +Print Knowledge Article +======================== +This module allow to print the Article from the Knowledge Module + +Installation +============ +- www.odoo.com/documentation/16.0/setup/install.html +- Install our custom addon + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +GNU AFFERO GENERAL PUBLIC LICENSE v3.0 (AGPL-3) +(http://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +Developer : (V16) Renu M, Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ diff --git a/print_knowledge_article/__init__.py b/print_knowledge_article/__init__.py new file mode 100644 index 000000000..a09cbf453 --- /dev/null +++ b/print_knowledge_article/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (Contact : odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0 (OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the +# Software or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT +# OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +# THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +################################################################################ +from . import models diff --git a/print_knowledge_article/__manifest__.py b/print_knowledge_article/__manifest__.py new file mode 100644 index 000000000..bf86d9863 --- /dev/null +++ b/print_knowledge_article/__manifest__.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (Contact : odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0 (OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the +# Software or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT +# OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +# THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +################################################################################ +{ + 'name': 'Print Knowledge Article', + 'version': '16.0.1.0.0', + 'category': 'Productivity', + 'summary': 'Print Article from Knowledge Module in PDF', + 'description': 'This module helps you to print a PDF report of a ' + 'knowledge article', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['knowledge'], + 'data': [ + 'report/print_knowledge_article_templates.xml', + 'report/print_knowledge_article_reports.xml', + 'views/knowledge_article_views.xml' + ], + 'images': ['static/description/banner.png'], + 'license': 'OPL-1', + 'installable': True, + 'auto_install': False, + 'application': False, + +} diff --git a/print_knowledge_article/doc/RELEASE_NOTES.md b/print_knowledge_article/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..26250848b --- /dev/null +++ b/print_knowledge_article/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 13.02.2024 +#### Version 16.0.1.0.0 +#### ADD +- Initial commit for Print Knowledge Article diff --git a/print_knowledge_article/models/__init__.py b/print_knowledge_article/models/__init__.py new file mode 100644 index 000000000..0679132d0 --- /dev/null +++ b/print_knowledge_article/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (Contact : odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0 (OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the +# Software or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT +# OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +# THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +################################################################################ +from . import knowledge_article diff --git a/print_knowledge_article/models/knowledge_article.py b/print_knowledge_article/models/knowledge_article.py new file mode 100644 index 000000000..25712c509 --- /dev/null +++ b/print_knowledge_article/models/knowledge_article.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (Contact : odoo@cybrosys.com) +# +# This program is under the terms of the Odoo Proprietary License v1.0 (OPL-1) +# It is forbidden to publish, distribute, sublicense, or sell copies of the +# Software or modified copies of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT +# OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +# THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +################################################################################ +from odoo import models + + +class Article(models.Model): + """Inheriting article model to give function to download the article""" + _inherit = 'knowledge.article' + + def action_knowledge_download(self): + """ Called by the download action from the form view action menu.""" + self.ensure_one() + if '