diff --git a/document_page_partner/README.rst b/document_page_partner/README.rst new file mode 100644 index 00000000000..97b5be028b5 --- /dev/null +++ b/document_page_partner/README.rst @@ -0,0 +1,82 @@ +=================================== +Link to a partner in document pages +=================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:551f3befa9a02d00f51e8256594e83f031d0f482ccdeae01bb56ff8b901760d9 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/17.0/document_page_partner + :alt: OCA/knowledge +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/knowledge-17-0/knowledge-17-0-document_page_partner + :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=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows you to organize your knowledgebase by partner. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To use this module, simply fill in a partner for some pages, then you +can search by partner or group by partner. + +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 to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Therp BV + +Contributors +------------ + +- Holger Brunn + +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_partner/__init__.py b/document_page_partner/__init__.py new file mode 100644 index 00000000000..c450fc83663 --- /dev/null +++ b/document_page_partner/__init__.py @@ -0,0 +1,19 @@ +############################################################################## +# +# This module copyright (C) 2015 Therp BV . +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## +from . import models diff --git a/document_page_partner/__manifest__.py b/document_page_partner/__manifest__.py new file mode 100644 index 00000000000..414f72ed121 --- /dev/null +++ b/document_page_partner/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2015-24 Therp BV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +{ + "name": "Link to a partner in document pages", + "version": "17.0.1.0.0", + "website": "https://github.com/OCA/knowledge", + "author": "Therp BV,Odoo Community Association (OCA)", + "license": "AGPL-3", + "category": "Knowledge Management", + "summary": "Allows to link doucment pages to a partner", + "depends": [ + "document_page", + ], + "data": [ + "views/document_page.xml", + ], + "installable": True, +} diff --git a/document_page_partner/i18n/document_page_partner.pot b/document_page_partner/i18n/document_page_partner.pot new file mode 100644 index 00000000000..3cd4ad177d3 --- /dev/null +++ b/document_page_partner/i18n/document_page_partner.pot @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * document_page_partner +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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_partner +#: model:ir.model,name:document_page_partner.model_document_page +msgid "Document Page" +msgstr "" + +#. module: document_page_partner +#: model:ir.model.fields,field_description:document_page_partner.field_document_page__partner_id +#: model_terms:ir.ui.view,arch_db:document_page_partner.view_wiki_filter +msgid "Partner" +msgstr "" diff --git a/document_page_partner/i18n/document_page_partner_id.pot b/document_page_partner/i18n/document_page_partner_id.pot new file mode 100644 index 00000000000..890a5c3fc78 --- /dev/null +++ b/document_page_partner/i18n/document_page_partner_id.pot @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * document_page_partner_id +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.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_partner_id +#: model:ir.model,name:document_page_partner_id.model_document_page +msgid "Document Page" +msgstr "" + +#. module: document_page_partner_id +#: model:ir.model.fields,field_description:document_page_partner_id.field_document_page_partner_id +#: model:ir.ui.view,arch_db:document_page_partner_id.view_wiki_filter +msgid "Partner" +msgstr "" + diff --git a/document_page_partner/i18n/es.po b/document_page_partner/i18n/es.po new file mode 100644 index 00000000000..19e053f6604 --- /dev/null +++ b/document_page_partner/i18n/es.po @@ -0,0 +1,28 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * document_page_partner +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-05-15 21:34+0000\n" +"Last-Translator: Sergio Ariel Ameghino \n" +"Language-Team: none\n" +"Language: es\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_partner +#: model:ir.model,name:document_page_partner.model_document_page +msgid "Document Page" +msgstr "Página del documento" + +#. module: document_page_partner +#: model:ir.model.fields,field_description:document_page_partner.field_document_page__partner_id +#: model_terms:ir.ui.view,arch_db:document_page_partner.view_wiki_filter +msgid "Partner" +msgstr "Empresa" diff --git a/document_page_partner/i18n/it.po b/document_page_partner/i18n/it.po new file mode 100644 index 00000000000..51e29763c67 --- /dev/null +++ b/document_page_partner/i18n/it.po @@ -0,0 +1,28 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * document_page_partner +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-04-02 11:04+0000\n" +"Last-Translator: mymage \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_partner +#: model:ir.model,name:document_page_partner.model_document_page +msgid "Document Page" +msgstr "Pagina documento" + +#. module: document_page_partner +#: model:ir.model.fields,field_description:document_page_partner.field_document_page__partner_id +#: model_terms:ir.ui.view,arch_db:document_page_partner.view_wiki_filter +msgid "Partner" +msgstr "Partner" diff --git a/document_page_partner/i18n/pt.po b/document_page_partner/i18n/pt.po new file mode 100644 index 00000000000..bbd28b4d40b --- /dev/null +++ b/document_page_partner/i18n/pt.po @@ -0,0 +1,28 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * document_page_partner +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-07-27 04:58+0000\n" +"Last-Translator: Peter Romão \n" +"Language-Team: none\n" +"Language: pt\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 5.6.2\n" + +#. module: document_page_partner +#: model:ir.model,name:document_page_partner.model_document_page +msgid "Document Page" +msgstr "Página do documento" + +#. module: document_page_partner +#: model:ir.model.fields,field_description:document_page_partner.field_document_page__partner_id +#: model_terms:ir.ui.view,arch_db:document_page_partner.view_wiki_filter +msgid "Partner" +msgstr "Parceiro" diff --git a/document_page_partner/models/__init__.py b/document_page_partner/models/__init__.py new file mode 100644 index 00000000000..8f706d51552 --- /dev/null +++ b/document_page_partner/models/__init__.py @@ -0,0 +1,3 @@ +# Copyright 2015-24 Therp BV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from . import document_page diff --git a/document_page_partner/models/document_page.py b/document_page_partner/models/document_page.py new file mode 100644 index 00000000000..425ec2cbf27 --- /dev/null +++ b/document_page_partner/models/document_page.py @@ -0,0 +1,9 @@ +# Copyright 2015-24 Therp BV +# 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" + + partner_id = fields.Many2one("res.partner", "Partner", index=True) diff --git a/document_page_partner/pyproject.toml b/document_page_partner/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/document_page_partner/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/document_page_partner/readme/CONTRIBUTORS.md b/document_page_partner/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..a089790bae1 --- /dev/null +++ b/document_page_partner/readme/CONTRIBUTORS.md @@ -0,0 +1 @@ +- Holger Brunn \<\> diff --git a/document_page_partner/readme/DESCRIPTION.md b/document_page_partner/readme/DESCRIPTION.md new file mode 100644 index 00000000000..98ec1212ebf --- /dev/null +++ b/document_page_partner/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This module allows you to organize your knowledgebase by partner. diff --git a/document_page_partner/readme/USAGE.md b/document_page_partner/readme/USAGE.md new file mode 100644 index 00000000000..f0636e40c11 --- /dev/null +++ b/document_page_partner/readme/USAGE.md @@ -0,0 +1,2 @@ +To use this module, simply fill in a partner for some pages, then you +can search by partner or group by partner. diff --git a/document_page_partner/static/description/icon.png b/document_page_partner/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/document_page_partner/static/description/icon.png differ diff --git a/document_page_partner/static/description/index.html b/document_page_partner/static/description/index.html new file mode 100644 index 00000000000..093aac5d073 --- /dev/null +++ b/document_page_partner/static/description/index.html @@ -0,0 +1,429 @@ + + + + + +Link to a partner in document pages + + + + + + diff --git a/document_page_partner/views/document_page.xml b/document_page_partner/views/document_page.xml new file mode 100644 index 00000000000..9c1f6baee08 --- /dev/null +++ b/document_page_partner/views/document_page.xml @@ -0,0 +1,38 @@ + + + + document.page + + + + + + + + + document.page + + + + + + + + + document.page + + + + + + + + + + + diff --git a/document_url/static/src/js/url.esm.js b/document_url/static/src/js/url.esm.js index 2ecfb553696..c2b4e1b1892 100644 --- a/document_url/static/src/js/url.esm.js +++ b/document_url/static/src/js/url.esm.js @@ -1,9 +1,9 @@ /** @odoo-module **/ +import {AttachmentList} from "@mail/core/common/attachment_list"; import {Chatter} from "@mail/core/web/chatter"; import {patch} from "@web/core/utils/patch"; import {url} from "@web/core/utils/urls"; -import {AttachmentList} from "@mail/core/common/attachment_list"; patch(Chatter.prototype, { _onAddUrl(event) { @@ -50,11 +50,12 @@ patch(AttachmentList.prototype, { * Return the url of the attachment. Temporary attachments, a.k.a. uploading * attachments, do not have an url. * + * @param {Object} attachment * @returns {String} */ canDownload(attachment) { return ( - super.canDownload(attachment) && attachment.mimetype != "application/link" + super.canDownload(attachment) && attachment.mimetype !== "application/link" ); }, get attachmentUrl() {