From 1bee5bd36d90c54f92784c86804b8ac488492f77 Mon Sep 17 00:00:00 2001 From: Carlos Roca Date: Thu, 22 Aug 2024 11:07:00 +0200 Subject: [PATCH 01/18] [ADD] web_editor_media_dialog_dms: New module to allow to set dms files as media in web editor --- web_editor_media_dialog_dms/README.rst | 97 ++++ web_editor_media_dialog_dms/__init__.py | 1 + web_editor_media_dialog_dms/__manifest__.py | 17 + web_editor_media_dialog_dms/i18n/es.po | 70 +++ .../i18n/web_editor_media_dialog_dms.pot | 68 +++ .../models/__init__.py | 2 + .../models/dms_file.py | 26 + .../models/ir_binary.py | 15 + .../readme/CONTRIBUTORS.rst | 4 + .../readme/DESCRIPTION.rst | 2 + web_editor_media_dialog_dms/readme/USAGE.rst | 13 + .../static/description/index.html | 444 ++++++++++++++++++ .../src/media_dialog/dms_selector.esm.js | 209 +++++++++ .../static/src/media_dialog/dms_selector.xml | 75 +++ .../src/media_dialog/media_dialog.esm.js | 43 ++ 15 files changed, 1086 insertions(+) create mode 100644 web_editor_media_dialog_dms/README.rst create mode 100644 web_editor_media_dialog_dms/__init__.py create mode 100644 web_editor_media_dialog_dms/__manifest__.py create mode 100644 web_editor_media_dialog_dms/i18n/es.po create mode 100644 web_editor_media_dialog_dms/i18n/web_editor_media_dialog_dms.pot create mode 100644 web_editor_media_dialog_dms/models/__init__.py create mode 100644 web_editor_media_dialog_dms/models/dms_file.py create mode 100644 web_editor_media_dialog_dms/models/ir_binary.py create mode 100644 web_editor_media_dialog_dms/readme/CONTRIBUTORS.rst create mode 100644 web_editor_media_dialog_dms/readme/DESCRIPTION.rst create mode 100644 web_editor_media_dialog_dms/readme/USAGE.rst create mode 100644 web_editor_media_dialog_dms/static/description/index.html create mode 100644 web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.esm.js create mode 100644 web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml create mode 100644 web_editor_media_dialog_dms/static/src/media_dialog/media_dialog.esm.js diff --git a/web_editor_media_dialog_dms/README.rst b/web_editor_media_dialog_dms/README.rst new file mode 100644 index 000000000..1af90ac29 --- /dev/null +++ b/web_editor_media_dialog_dms/README.rst @@ -0,0 +1,97 @@ +=========================== +Web Editor Media Dialog DMS +=========================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:61e7939eaa7373b7c5114e669fe2cb623fba465e7f682708680aebee1ceddee2 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fdms-lightgray.png?logo=github + :target: https://github.com/OCA/dms/tree/16.0/web_editor_media_dialog_dms + :alt: OCA/dms +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/dms-16-0/dms-16-0-web_editor_media_dialog_dms + :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/dms&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds the option in the web editor to include an image with the +corresponding link to open/download the linked files. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To use this module, we need: + +#. Navigate to a model that has an HTML field +#. Edit the field +#. Type /image to open the media dialog +#. Select the DMS tab +#. Select the DMS file to be added + +You can also edit the selected file making a double click on the image added to web +editor. + +If you want to share the file to a public user, you can do it by selecting the option +**Allow open to public users** which is located on DMS tab of media dialog. + +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 +~~~~~~~ + +* Tecnativa + +Contributors +~~~~~~~~~~~~ + +* `Tecnativa `_: + + * Pedro M. Baeza + * Carlos Roca + +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/dms `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/web_editor_media_dialog_dms/__init__.py b/web_editor_media_dialog_dms/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/web_editor_media_dialog_dms/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/web_editor_media_dialog_dms/__manifest__.py b/web_editor_media_dialog_dms/__manifest__.py new file mode 100644 index 000000000..59542e19e --- /dev/null +++ b/web_editor_media_dialog_dms/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2024 Tecnativa - Carlos Roca +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Web Editor Media Dialog DMS", + "summary": "Integrate DMS with media dialog of web editor", + "version": "16.0.1.0.0", + "license": "AGPL-3", + "author": "Tecnativa, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/dms", + "depends": ["dms", "web_editor"], + "assets": { + "web_editor.assets_media_dialog": [ + "web_editor_media_dialog_dms/static/src/media_dialog/*", + ] + }, +} diff --git a/web_editor_media_dialog_dms/i18n/es.po b/web_editor_media_dialog_dms/i18n/es.po new file mode 100644 index 000000000..e863a1cad --- /dev/null +++ b/web_editor_media_dialog_dms/i18n/es.po @@ -0,0 +1,70 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_editor_media_dialog_dms +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-08-22 09:04+0000\n" +"PO-Revision-Date: 2024-08-22 11:05+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.0.1\n" + +#. module: web_editor_media_dialog_dms +#. odoo-javascript +#: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 +#, python-format +msgid "All DMS files have been loaded" +msgstr "Todos los archivos DMS han sido cargados" + +#. module: web_editor_media_dialog_dms +#. odoo-javascript +#: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 +#, python-format +msgid "Allow open to public users" +msgstr "Permitir abrir enlace a usuarios públicos" + +#. module: web_editor_media_dialog_dms +#: model:ir.model,name:web_editor_media_dialog_dms.model_dms_file +msgid "File" +msgstr "Archivo" + +#. module: web_editor_media_dialog_dms +#: model:ir.model,name:web_editor_media_dialog_dms.model_ir_binary +msgid "File streaming helper model for controllers" +msgstr "Modelo de ayuda para la transmisión de archivos para controladores" + +#. module: web_editor_media_dialog_dms +#. odoo-python +#: code:addons/web_editor_media_dialog_dms/models/dms_file.py:0 +#, python-format +msgid "Invalid access token" +msgstr "Token de acceso inválido" + +#. module: web_editor_media_dialog_dms +#. odoo-javascript +#: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 +#, python-format +msgid "Load more..." +msgstr "Cargar más..." + +#. module: web_editor_media_dialog_dms +#. odoo-javascript +#: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 +#, python-format +msgid "No DMS files found." +msgstr "No se encontraron archivos DMS." + +#. module: web_editor_media_dialog_dms +#. odoo-javascript +#: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.esm.js:0 +#, python-format +msgid "Search a dms file" +msgstr "Buscar un archivo DMS" diff --git a/web_editor_media_dialog_dms/i18n/web_editor_media_dialog_dms.pot b/web_editor_media_dialog_dms/i18n/web_editor_media_dialog_dms.pot new file mode 100644 index 000000000..48d834746 --- /dev/null +++ b/web_editor_media_dialog_dms/i18n/web_editor_media_dialog_dms.pot @@ -0,0 +1,68 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_editor_media_dialog_dms +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-08-22 09:04+0000\n" +"PO-Revision-Date: 2024-08-22 09:04+0000\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: web_editor_media_dialog_dms +#. odoo-javascript +#: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 +#, python-format +msgid "All DMS files have been loaded" +msgstr "" + +#. module: web_editor_media_dialog_dms +#. odoo-javascript +#: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 +#, python-format +msgid "Allow open to public users" +msgstr "" + +#. module: web_editor_media_dialog_dms +#: model:ir.model,name:web_editor_media_dialog_dms.model_dms_file +msgid "File" +msgstr "" + +#. module: web_editor_media_dialog_dms +#: model:ir.model,name:web_editor_media_dialog_dms.model_ir_binary +msgid "File streaming helper model for controllers" +msgstr "" + +#. module: web_editor_media_dialog_dms +#. odoo-python +#: code:addons/web_editor_media_dialog_dms/models/dms_file.py:0 +#, python-format +msgid "Invalid access token" +msgstr "" + +#. module: web_editor_media_dialog_dms +#. odoo-javascript +#: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 +#, python-format +msgid "Load more..." +msgstr "" + +#. module: web_editor_media_dialog_dms +#. odoo-javascript +#: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 +#, python-format +msgid "No DMS files found." +msgstr "" + +#. module: web_editor_media_dialog_dms +#. odoo-javascript +#: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.esm.js:0 +#, python-format +msgid "Search a dms file" +msgstr "" diff --git a/web_editor_media_dialog_dms/models/__init__.py b/web_editor_media_dialog_dms/models/__init__.py new file mode 100644 index 000000000..078d8008c --- /dev/null +++ b/web_editor_media_dialog_dms/models/__init__.py @@ -0,0 +1,2 @@ +from . import dms_file +from . import ir_binary diff --git a/web_editor_media_dialog_dms/models/dms_file.py b/web_editor_media_dialog_dms/models/dms_file.py new file mode 100644 index 000000000..3b6d4447a --- /dev/null +++ b/web_editor_media_dialog_dms/models/dms_file.py @@ -0,0 +1,26 @@ +# Copyright 2024 Tecnativa - Carlos Roca +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). + +from odoo import _, models +from odoo.exceptions import AccessError +from odoo.tools import consteq + + +class File(models.Model): + _inherit = "dms.file" + + def get_access_token(self): + self.ensure_one() + return self._portal_ensure_token() + + def validate_access(self, access_token): + # Validate if token provided is correct for the record checked + self.ensure_one() + record_sudo = self.sudo() + if access_token: + tok = record_sudo.with_context(prefetch_fields=False).access_token + valid_token = consteq(tok or "", access_token) + if not valid_token: + raise AccessError(_("Invalid access token")) + return record_sudo + return self diff --git a/web_editor_media_dialog_dms/models/ir_binary.py b/web_editor_media_dialog_dms/models/ir_binary.py new file mode 100644 index 000000000..4ad8de485 --- /dev/null +++ b/web_editor_media_dialog_dms/models/ir_binary.py @@ -0,0 +1,15 @@ +# Copyright 2024 Tecnativa - Carlos Roca +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). + +from odoo import models + + +class IrBinary(models.AbstractModel): + _inherit = "ir.binary" + + def _find_record_check_access(self, record, access_token): + # The method is overridden to allow access to the media attached to the + # dms.file records using an access_token. + if record._name == "dms.file": + return record.validate_access(access_token) + return super()._find_record_check_access(record, access_token) diff --git a/web_editor_media_dialog_dms/readme/CONTRIBUTORS.rst b/web_editor_media_dialog_dms/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..42f94d59e --- /dev/null +++ b/web_editor_media_dialog_dms/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +* `Tecnativa `_: + + * Pedro M. Baeza + * Carlos Roca diff --git a/web_editor_media_dialog_dms/readme/DESCRIPTION.rst b/web_editor_media_dialog_dms/readme/DESCRIPTION.rst new file mode 100644 index 000000000..8825a2011 --- /dev/null +++ b/web_editor_media_dialog_dms/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +This module adds the option in the web editor to include an image with the +corresponding link to open/download the linked files. diff --git a/web_editor_media_dialog_dms/readme/USAGE.rst b/web_editor_media_dialog_dms/readme/USAGE.rst new file mode 100644 index 000000000..37de7e8b4 --- /dev/null +++ b/web_editor_media_dialog_dms/readme/USAGE.rst @@ -0,0 +1,13 @@ +To use this module, we need: + +#. Navigate to a model that has an HTML field +#. Edit the field +#. Type /image to open the media dialog +#. Select the DMS tab +#. Select the DMS file to be added + +You can also edit the selected file making a double click on the image added to web +editor. + +If you want to share the file to a public user, you can do it by selecting the option +**Allow open to public users** which is located on DMS tab of media dialog. \ No newline at end of file diff --git a/web_editor_media_dialog_dms/static/description/index.html b/web_editor_media_dialog_dms/static/description/index.html new file mode 100644 index 000000000..8a7ec333f --- /dev/null +++ b/web_editor_media_dialog_dms/static/description/index.html @@ -0,0 +1,444 @@ + + + + + +Web Editor Media Dialog DMS + + + +
+

Web Editor Media Dialog DMS

+ + +

Beta License: AGPL-3 OCA/dms Translate me on Weblate Try me on Runboat

+

This module adds the option in the web editor to include an image with the +corresponding link to open/download the linked files.

+

Table of contents

+ +
+

Usage

+

To use this module, we need:

+
    +
  1. Navigate to a model that has an HTML field
  2. +
  3. Edit the field
  4. +
  5. Type /image to open the media dialog
  6. +
  7. Select the DMS tab
  8. +
  9. Select the DMS file to be added
  10. +
+

You can also edit the selected file making a double click on the image added to web +editor.

+

If you want to share the file to a public user, you can do it by selecting the option +Allow open to public users which is located on DMS tab of media dialog.

+
+
+

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

+
    +
  • Tecnativa
  • +
+
+
+

Contributors

+
    +
  • Tecnativa:
      +
    • Pedro M. Baeza
    • +
    • Carlos Roca
    • +
    +
  • +
+
+
+

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

+

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

+
+
+
+ + diff --git a/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.esm.js b/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.esm.js new file mode 100644 index 000000000..a4352a85a --- /dev/null +++ b/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.esm.js @@ -0,0 +1,209 @@ +/** @odoo-module */ + +import {SearchMedia} from "@web_editor/components/media_dialog/search_media"; +import {KeepLast} from "@web/core/utils/concurrency"; +import {useDebounced} from "@web/core/utils/timing"; +import {useService} from "@web/core/utils/hooks"; +import {Component, onWillStart, useRef, useState} from "@odoo/owl"; + +export class DMSFile extends Component {} +DMSFile.template = "web_editor_media_dialog_dms.DMSFile"; + +export class DMSSelector extends Component { + setup() { + this.orm = useService("orm"); + this.keepLast = new KeepLast(); + this.loadMoreButtonRef = useRef("load-more-button"); + this.state = useState({ + dmsFiles: [], + canLoadMoreFiles: true, + isFetchingFiles: false, + needle: "", + }); + this.allowOpenPublic = false; + this.NUMBER_OF_FILES_TO_DISPLAY = 30; + this.searchPlaceholder = this.env._t("Search a dms file"); + onWillStart(async () => { + this.state.dmsFiles = await this.fetchFiles( + this.NUMBER_OF_FILES_TO_DISPLAY, + 0 + ); + }); + this.debouncedScroll = useDebounced(this.scrollToLoadMoreButton, 500); + } + + get canLoadMore() { + return this.state.canLoadMoreFiles; + } + + get hasContent() { + return this.state.dmsFiles.length; + } + + get isFetching() { + return this.state.isFetchingFiles; + } + + get selectedFileIds() { + return this.props.selectedMedia[this.props.id] + .filter((media) => media.mediaType === "dms") + .map(({id}) => id); + } + + async fetchFiles(limit, offset) { + this.state.isFetchingFiles = true; + let files = []; + try { + files = await this.orm.searchRead( + "dms.file", + [["name", "ilike", this.state.needle]], + ["name", "mimetype"], + { + order: "id desc", + limit, + offset, + } + ); + } catch (e) { + if (e.exceptionName !== "odoo.exceptions.AccessError") { + throw e; + } + } + this.state.canLoadMoreFiles = files.length >= this.NUMBER_OF_FILES_TO_DISPLAY; + this.state.isFetchingFiles = false; + if (this.selectInitialMedia()) { + for (const file of files) { + if ( + `/web/content/dms.file/${file.id}/content` === + this.props.media.getAttribute("href").replace(/[?].*/, "") + ) { + this.selectFile(file); + } + } + } + for (const file of files) { + file.allowOpenPublic = this.allowOpenPublic; + } + return files; + } + + async handleLoadMore() { + await this.loadMore(); + this.debouncedScroll(); + } + + async loadMore() { + return this.keepLast + .add( + this.fetchFiles( + this.NUMBER_OF_FILES_TO_DISPLAY, + this.state.dmsFiles.length + ) + ) + .then((newFiles) => { + // This is never reached if another search or loadMore occurred. + this.state.dmsFiles.push(...newFiles); + }); + } + + async handleSearch(needle) { + await this.search(needle); + this.debouncedScroll(); + } + + search(needle) { + this.state.dmsFiles = []; + this.state.needle = needle; + return this.keepLast + .add(this.fetchFiles(this.NUMBER_OF_FILES_TO_DISPLAY, 0)) + .then((files) => { + this.state.dmsFiles = files; + }); + } + + scrollToLoadMoreButton() { + if ( + this.state.needle || + this.state.dmsFiles.length > this.NUMBER_OF_FILES_TO_DISPLAY + ) { + this.loadMoreButtonRef.el.scrollIntoView({ + block: "end", + inline: "nearest", + behavior: "smooth", + }); + } + } + + async onClickFile(file) { + this.props.selectMedia({...file, mediaType: "dms"}); + await this.props.save(); + } + + static async createElements(selectedMedia, {orm}) { + return Promise.all( + selectedMedia.map(async (file) => { + const linkEl = document.createElement("a"); + let href = `/web/content/dms.file/${encodeURIComponent( + file.id + )}/content`; + // Download svg images because are considered images but are not + // visualized correctly on new tab. Other files than pdf or image are + // downloaded by default + var extra_added = false; + if (file.mimetype === "image/svg+xml") { + href += "?download=true"; + extra_added = true; + } + if (file.allowOpenPublic) { + const accessToken = await orm.call("dms.file", "get_access_token", [ + file.id, + ]); + href += `${ + extra_added ? "&" : "?" + }access_token=${encodeURIComponent(accessToken)}`; + extra_added = true; + } + linkEl.href = href; + linkEl.title = file.name; + linkEl.dataset.mimetype = file.mimetype; + return linkEl; + }) + ); + } + + selectFile(file) { + this.props.selectMedia({...file, mediaType: "dms"}); + } + + selectInitialMedia() { + return ( + this.props.media && + this.constructor.tagNames.includes(this.props.media.tagName) && + !this.selectedFileIds.length + ); + } + + async handleChangeAllowOpenPublic() { + await this.changeAllowOpenPublic(); + this.debouncedScroll(); + } + + changeAllowOpenPublic() { + this.allowOpenPublic = !this.allowOpenPublic; + return this.keepLast + .add(this.fetchFiles(this.state.dmsFiles.length, 0)) + .then((files) => { + this.state.dmsFiles = files; + }); + } +} + +DMSSelector.template = "web_editor_media_dialog_dms.DMSSelector"; +DMSSelector.mediaSpecificClasses = ["o_image", "o_dms_file"]; +DMSSelector.mediaSpecificStyles = []; +DMSSelector.mediaExtraClasses = []; +DMSSelector.tagNames = ["A"]; +DMSSelector.components = { + DMSFile, + SearchMedia, +}; diff --git a/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml b/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml new file mode 100644 index 000000000..1e1b4d5d5 --- /dev/null +++ b/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml @@ -0,0 +1,75 @@ + + + +
+ + + +
+
+ +
+
+ + +
+
+
+
+

No DMS files found.

+
+
+ + + +
+
+ +
+ All DMS files have been loaded +
+
+
+
+ diff --git a/web_editor_media_dialog_dms/static/src/media_dialog/media_dialog.esm.js b/web_editor_media_dialog_dms/static/src/media_dialog/media_dialog.esm.js new file mode 100644 index 000000000..ebc67492a --- /dev/null +++ b/web_editor_media_dialog_dms/static/src/media_dialog/media_dialog.esm.js @@ -0,0 +1,43 @@ +/** @odoo-module **/ + +import {MediaDialog, TABS} from "@web_editor/components/media_dialog/media_dialog"; +import {DMSSelector} from "./dms_selector.esm"; +import {patch} from "@web/core/utils/patch"; + +patch(TABS, "web_editor_media_dialog_dms.TABS", { + DMS: { + id: "DMS", + title: "DMS", + Component: DMSSelector, + }, +}); + +patch(MediaDialog.prototype, "web_editor_media_dialog_dms.MediaDialog", { + get initialActiveTab() { + const dmsTab = this.tabs.find((tab) => tab.id === "DMS"); + if ( + !this.props.activeTab && + dmsTab && + this.props.media && + this.props.media.classList.contains("o_dms_file") + ) { + return dmsTab.id; + } + return this._super(...arguments); + }, + addTabs() { + const res = this._super(...arguments); + const onlyImages = + this.props.onlyImages || + this.props.multiImages || + (this.props.media && + this.props.media.parentElement && + (this.props.media.parentElement.dataset.oeField === "image" || + this.props.media.parentElement.dataset.oeType === "image")); + const noDMS = onlyImages || this.props.noDMS; + if (!noDMS) { + this.addTab(TABS.DMS); + } + return res; + }, +}); From b2c7c4d39b2bab926a73fc855e6b991991ad574a Mon Sep 17 00:00:00 2001 From: oca-ci Date: Tue, 27 Aug 2024 09:13:00 +0000 Subject: [PATCH 02/18] [UPD] Update web_editor_media_dialog_dms.pot --- .../i18n/web_editor_media_dialog_dms.pot | 2 -- 1 file changed, 2 deletions(-) diff --git a/web_editor_media_dialog_dms/i18n/web_editor_media_dialog_dms.pot b/web_editor_media_dialog_dms/i18n/web_editor_media_dialog_dms.pot index 48d834746..81db41499 100644 --- a/web_editor_media_dialog_dms/i18n/web_editor_media_dialog_dms.pot +++ b/web_editor_media_dialog_dms/i18n/web_editor_media_dialog_dms.pot @@ -6,8 +6,6 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-08-22 09:04+0000\n" -"PO-Revision-Date: 2024-08-22 09:04+0000\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" From d0dcc8d211b39d96fe5986289dee003f52a97e68 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Tue, 27 Aug 2024 09:15:46 +0000 Subject: [PATCH 03/18] [BOT] post-merge updates --- web_editor_media_dialog_dms/README.rst | 2 +- .../static/description/icon.png | Bin 0 -> 9455 bytes .../static/description/index.html | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 web_editor_media_dialog_dms/static/description/icon.png diff --git a/web_editor_media_dialog_dms/README.rst b/web_editor_media_dialog_dms/README.rst index 1af90ac29..6cd0573b4 100644 --- a/web_editor_media_dialog_dms/README.rst +++ b/web_editor_media_dialog_dms/README.rst @@ -7,7 +7,7 @@ Web Editor Media Dialog DMS !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:61e7939eaa7373b7c5114e669fe2cb623fba465e7f682708680aebee1ceddee2 + !! source digest: sha256:cc57658ce5d4b5187afb21e817001519e004eb3e2e10fa4e3897b5c9e3e3f129 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/web_editor_media_dialog_dms/static/description/icon.png b/web_editor_media_dialog_dms/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d GIT binary patch literal 9455 zcmW++2RxMjAAjx~&dlBk9S+%}OXg)AGE&Cb*&}d0jUxM@u(PQx^-s)697TX`ehR4?GS^qbkof1cslKgkU)h65qZ9Oc=ml_0tem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b zOr}WVFP--DsS`1WpN%~)t3R!arKF^Q$e12KEqU36AWwnCBICpH4XCsfnyrHr>$I$4 z!DpKX$OKLWarN7nv@!uIA+~RNO)l$$w}p(;b>mx8pwYvu;dD_unryX_NhT8*Tj>BTrTTL&!?O+%Rv;b?B??gSzdp?6Uug9{ zd@V08Z$BdI?fpoCS$)t4mg4rT8Q_I}h`0d-vYZ^|dOB*Q^S|xqTV*vIg?@fVFSmMpaw0qtTRbx} z({Pg?#{2`sc9)M5N$*N|4;^t$+QP?#mov zGVC@I*lBVrOU-%2y!7%)fAKjpEFsgQc4{amtiHb95KQEwvf<(3T<9-Zm$xIew#P22 zc2Ix|App^>v6(3L_MCU0d3W##AB0M~3D00EWoKZqsJYT(#@w$Y_H7G22M~ApVFTRHMI_3be)Lkn#0F*V8Pq zc}`Cjy$bE;FJ6H7p=0y#R>`}-m4(0F>%@P|?7fx{=R^uFdISRnZ2W_xQhD{YuR3t< z{6yxu=4~JkeA;|(J6_nv#>Nvs&FuLA&PW^he@t(UwFFE8)|a!R{`E`K`i^ZnyE4$k z;(749Ix|oi$c3QbEJ3b~D_kQsPz~fIUKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{} zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N Xviia!U7SGha1wx#SCgwmn*{w2TRX*I literal 0 HcmV?d00001 diff --git a/web_editor_media_dialog_dms/static/description/index.html b/web_editor_media_dialog_dms/static/description/index.html index 8a7ec333f..42dead100 100644 --- a/web_editor_media_dialog_dms/static/description/index.html +++ b/web_editor_media_dialog_dms/static/description/index.html @@ -367,7 +367,7 @@

Web Editor Media Dialog DMS

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:61e7939eaa7373b7c5114e669fe2cb623fba465e7f682708680aebee1ceddee2 +!! source digest: sha256:cc57658ce5d4b5187afb21e817001519e004eb3e2e10fa4e3897b5c9e3e3f129 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Beta License: AGPL-3 OCA/dms Translate me on Weblate Try me on Runboat

This module adds the option in the web editor to include an image with the From 97b937efe850e34322b5bd5fb3b250e982fbd72c Mon Sep 17 00:00:00 2001 From: mymage Date: Thu, 29 Aug 2024 10:12:37 +0000 Subject: [PATCH 04/18] Added translation using Weblate (Italian) --- web_editor_media_dialog_dms/i18n/it.po | 67 ++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 web_editor_media_dialog_dms/i18n/it.po diff --git a/web_editor_media_dialog_dms/i18n/it.po b/web_editor_media_dialog_dms/i18n/it.po new file mode 100644 index 000000000..2b0faf84a --- /dev/null +++ b/web_editor_media_dialog_dms/i18n/it.po @@ -0,0 +1,67 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_editor_media_dialog_dms +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\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" + +#. module: web_editor_media_dialog_dms +#. odoo-javascript +#: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 +#, python-format +msgid "All DMS files have been loaded" +msgstr "" + +#. module: web_editor_media_dialog_dms +#. odoo-javascript +#: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 +#, python-format +msgid "Allow open to public users" +msgstr "" + +#. module: web_editor_media_dialog_dms +#: model:ir.model,name:web_editor_media_dialog_dms.model_dms_file +msgid "File" +msgstr "" + +#. module: web_editor_media_dialog_dms +#: model:ir.model,name:web_editor_media_dialog_dms.model_ir_binary +msgid "File streaming helper model for controllers" +msgstr "" + +#. module: web_editor_media_dialog_dms +#. odoo-python +#: code:addons/web_editor_media_dialog_dms/models/dms_file.py:0 +#, python-format +msgid "Invalid access token" +msgstr "" + +#. module: web_editor_media_dialog_dms +#. odoo-javascript +#: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 +#, python-format +msgid "Load more..." +msgstr "" + +#. module: web_editor_media_dialog_dms +#. odoo-javascript +#: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 +#, python-format +msgid "No DMS files found." +msgstr "" + +#. module: web_editor_media_dialog_dms +#. odoo-javascript +#: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.esm.js:0 +#, python-format +msgid "Search a dms file" +msgstr "" From 242ced8a492325b713f5a82888d71fce3debacbe Mon Sep 17 00:00:00 2001 From: mymage Date: Thu, 29 Aug 2024 10:20:32 +0000 Subject: [PATCH 05/18] Translated using Weblate (Italian) Currently translated at 100.0% (8 of 8 strings) Translation: dms-16.0/dms-16.0-web_editor_media_dialog_dms Translate-URL: https://translation.odoo-community.org/projects/dms-16-0/dms-16-0-web_editor_media_dialog_dms/it/ --- web_editor_media_dialog_dms/i18n/it.po | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/web_editor_media_dialog_dms/i18n/it.po b/web_editor_media_dialog_dms/i18n/it.po index 2b0faf84a..71ed9b62f 100644 --- a/web_editor_media_dialog_dms/i18n/it.po +++ b/web_editor_media_dialog_dms/i18n/it.po @@ -6,62 +6,64 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2024-08-29 13:06+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 5.6.2\n" #. module: web_editor_media_dialog_dms #. odoo-javascript #: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 #, python-format msgid "All DMS files have been loaded" -msgstr "" +msgstr "Tutti i file DMS sono stati caricati" #. module: web_editor_media_dialog_dms #. odoo-javascript #: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 #, python-format msgid "Allow open to public users" -msgstr "" +msgstr "Consenti l'apertura a utenti pubblici" #. module: web_editor_media_dialog_dms #: model:ir.model,name:web_editor_media_dialog_dms.model_dms_file msgid "File" -msgstr "" +msgstr "File" #. module: web_editor_media_dialog_dms #: model:ir.model,name:web_editor_media_dialog_dms.model_ir_binary msgid "File streaming helper model for controllers" -msgstr "" +msgstr "Modello aiuto streaming file per controller" #. module: web_editor_media_dialog_dms #. odoo-python #: code:addons/web_editor_media_dialog_dms/models/dms_file.py:0 #, python-format msgid "Invalid access token" -msgstr "" +msgstr "Token accesso non valido" #. module: web_editor_media_dialog_dms #. odoo-javascript #: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 #, python-format msgid "Load more..." -msgstr "" +msgstr "Carica altri..." #. module: web_editor_media_dialog_dms #. odoo-javascript #: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 #, python-format msgid "No DMS files found." -msgstr "" +msgstr "Nessun file DMS trovato." #. module: web_editor_media_dialog_dms #. odoo-javascript #: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.esm.js:0 #, python-format msgid "Search a dms file" -msgstr "" +msgstr "Cerca un file DMS" From fda62deea412f2535b45e400e4a4480a4456d079 Mon Sep 17 00:00:00 2001 From: CarlosRoca13 Date: Fri, 9 May 2025 10:39:23 +0200 Subject: [PATCH 06/18] [IMP] web_editor_media_dialog_dms: pre-commit auto fixes --- web_editor_media_dialog_dms/README.rst | 45 ++++++++++--------- web_editor_media_dialog_dms/pyproject.toml | 3 ++ .../readme/CONTRIBUTORS.md | 3 ++ .../readme/CONTRIBUTORS.rst | 4 -- .../readme/DESCRIPTION.md | 2 + .../readme/DESCRIPTION.rst | 2 - web_editor_media_dialog_dms/readme/USAGE.md | 14 ++++++ web_editor_media_dialog_dms/readme/USAGE.rst | 13 ------ .../static/description/index.html | 19 ++++---- .../static/src/media_dialog/dms_selector.xml | 4 +- 10 files changed, 58 insertions(+), 51 deletions(-) create mode 100644 web_editor_media_dialog_dms/pyproject.toml create mode 100644 web_editor_media_dialog_dms/readme/CONTRIBUTORS.md delete mode 100644 web_editor_media_dialog_dms/readme/CONTRIBUTORS.rst create mode 100644 web_editor_media_dialog_dms/readme/DESCRIPTION.md delete mode 100644 web_editor_media_dialog_dms/readme/DESCRIPTION.rst create mode 100644 web_editor_media_dialog_dms/readme/USAGE.md delete mode 100644 web_editor_media_dialog_dms/readme/USAGE.rst diff --git a/web_editor_media_dialog_dms/README.rst b/web_editor_media_dialog_dms/README.rst index 6cd0573b4..acead953d 100644 --- a/web_editor_media_dialog_dms/README.rst +++ b/web_editor_media_dialog_dms/README.rst @@ -17,19 +17,19 @@ Web Editor Media Dialog DMS :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fdms-lightgray.png?logo=github - :target: https://github.com/OCA/dms/tree/16.0/web_editor_media_dialog_dms + :target: https://github.com/OCA/dms/tree/18.0/web_editor_media_dialog_dms :alt: OCA/dms .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/dms-16-0/dms-16-0-web_editor_media_dialog_dms + :target: https://translation.odoo-community.org/projects/dms-18-0/dms-18-0-web_editor_media_dialog_dms :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/dms&target_branch=16.0 + :target: https://runboat.odoo-community.org/builds?repo=OCA/dms&target_branch=18.0 :alt: Try me on Runboat |badge1| |badge2| |badge3| |badge4| |badge5| -This module adds the option in the web editor to include an image with the -corresponding link to open/download the linked files. +This module adds the option in the web editor to include an image with +the corresponding link to open/download the linked files. **Table of contents** @@ -41,17 +41,18 @@ Usage To use this module, we need: -#. Navigate to a model that has an HTML field -#. Edit the field -#. Type /image to open the media dialog -#. Select the DMS tab -#. Select the DMS file to be added +1. Navigate to a model that has an HTML field +2. Edit the field +3. Type /image to open the media dialog +4. Select the DMS tab +5. Select the DMS file to be added -You can also edit the selected file making a double click on the image added to web -editor. +You can also edit the selected file making a double click on the image +added to web editor. -If you want to share the file to a public user, you can do it by selecting the option -**Allow open to public users** which is located on DMS tab of media dialog. +If you want to share the file to a public user, you can do it by +selecting the option **Allow open to public users** which is located on +DMS tab of media dialog. Bug Tracker =========== @@ -59,7 +60,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 to smash it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -67,20 +68,20 @@ Credits ======= Authors -~~~~~~~ +------- * Tecnativa Contributors -~~~~~~~~~~~~ +------------ -* `Tecnativa `_: +- `Tecnativa `__: - * Pedro M. Baeza - * Carlos Roca + - Pedro M. Baeza + - Carlos Roca Maintainers -~~~~~~~~~~~ +----------- This module is maintained by the OCA. @@ -92,6 +93,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/dms `_ project on GitHub. +This module is part of the `OCA/dms `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/web_editor_media_dialog_dms/pyproject.toml b/web_editor_media_dialog_dms/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/web_editor_media_dialog_dms/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/web_editor_media_dialog_dms/readme/CONTRIBUTORS.md b/web_editor_media_dialog_dms/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..b7d9c3bac --- /dev/null +++ b/web_editor_media_dialog_dms/readme/CONTRIBUTORS.md @@ -0,0 +1,3 @@ +- [Tecnativa](https://www.tecnativa.com): + - Pedro M. Baeza + - Carlos Roca diff --git a/web_editor_media_dialog_dms/readme/CONTRIBUTORS.rst b/web_editor_media_dialog_dms/readme/CONTRIBUTORS.rst deleted file mode 100644 index 42f94d59e..000000000 --- a/web_editor_media_dialog_dms/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,4 +0,0 @@ -* `Tecnativa `_: - - * Pedro M. Baeza - * Carlos Roca diff --git a/web_editor_media_dialog_dms/readme/DESCRIPTION.md b/web_editor_media_dialog_dms/readme/DESCRIPTION.md new file mode 100644 index 000000000..86fd851a3 --- /dev/null +++ b/web_editor_media_dialog_dms/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +This module adds the option in the web editor to include an image with +the corresponding link to open/download the linked files. diff --git a/web_editor_media_dialog_dms/readme/DESCRIPTION.rst b/web_editor_media_dialog_dms/readme/DESCRIPTION.rst deleted file mode 100644 index 8825a2011..000000000 --- a/web_editor_media_dialog_dms/readme/DESCRIPTION.rst +++ /dev/null @@ -1,2 +0,0 @@ -This module adds the option in the web editor to include an image with the -corresponding link to open/download the linked files. diff --git a/web_editor_media_dialog_dms/readme/USAGE.md b/web_editor_media_dialog_dms/readme/USAGE.md new file mode 100644 index 000000000..c1dd572c5 --- /dev/null +++ b/web_editor_media_dialog_dms/readme/USAGE.md @@ -0,0 +1,14 @@ +To use this module, we need: + +1. Navigate to a model that has an HTML field +2. Edit the field +3. Type /image to open the media dialog +4. Select the DMS tab +5. Select the DMS file to be added + +You can also edit the selected file making a double click on the image +added to web editor. + +If you want to share the file to a public user, you can do it by +selecting the option **Allow open to public users** which is located on +DMS tab of media dialog. diff --git a/web_editor_media_dialog_dms/readme/USAGE.rst b/web_editor_media_dialog_dms/readme/USAGE.rst deleted file mode 100644 index 37de7e8b4..000000000 --- a/web_editor_media_dialog_dms/readme/USAGE.rst +++ /dev/null @@ -1,13 +0,0 @@ -To use this module, we need: - -#. Navigate to a model that has an HTML field -#. Edit the field -#. Type /image to open the media dialog -#. Select the DMS tab -#. Select the DMS file to be added - -You can also edit the selected file making a double click on the image added to web -editor. - -If you want to share the file to a public user, you can do it by selecting the option -**Allow open to public users** which is located on DMS tab of media dialog. \ No newline at end of file diff --git a/web_editor_media_dialog_dms/static/description/index.html b/web_editor_media_dialog_dms/static/description/index.html index 42dead100..347b826c1 100644 --- a/web_editor_media_dialog_dms/static/description/index.html +++ b/web_editor_media_dialog_dms/static/description/index.html @@ -369,9 +369,9 @@

Web Editor Media Dialog DMS

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:cc57658ce5d4b5187afb21e817001519e004eb3e2e10fa4e3897b5c9e3e3f129 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/dms Translate me on Weblate Try me on Runboat

-

This module adds the option in the web editor to include an image with the -corresponding link to open/download the linked files.

+

Beta License: AGPL-3 OCA/dms Translate me on Weblate Try me on Runboat

+

This module adds the option in the web editor to include an image with +the corresponding link to open/download the linked files.

Table of contents

    @@ -395,17 +395,18 @@

    Usage

  • Select the DMS tab
  • Select the DMS file to be added
  • -

    You can also edit the selected file making a double click on the image added to web -editor.

    -

    If you want to share the file to a public user, you can do it by selecting the option -Allow open to public users which is located on DMS tab of media dialog.

    +

    You can also edit the selected file making a double click on the image +added to web editor.

    +

    If you want to share the file to a public user, you can do it by +selecting the option Allow open to public users which is located on +DMS tab of media dialog.

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.

+feedback.

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

@@ -435,7 +436,7 @@

Maintainers

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

+

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

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

diff --git a/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml b/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml index 1e1b4d5d5..9b63ef482 100644 --- a/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml +++ b/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml @@ -67,7 +67,9 @@ t-on-click="loadMore" >Load more...
- All DMS files have been loaded + + All DMS files have been loaded +
From 6dbaf06875569d29c9cdbeb4eb1f66e4f528d39a Mon Sep 17 00:00:00 2001 From: CarlosRoca13 Date: Fri, 9 May 2025 13:24:34 +0200 Subject: [PATCH 07/18] [MIG] web_editor_media_dialog_dms: Migration to 18.0 --- web_editor_media_dialog_dms/__manifest__.py | 4 +-- .../src/media_dialog/dms_selector.esm.js | 26 ++++++++----------- .../src/media_dialog/media_dialog.esm.js | 18 ++++++------- 3 files changed, 22 insertions(+), 26 deletions(-) diff --git a/web_editor_media_dialog_dms/__manifest__.py b/web_editor_media_dialog_dms/__manifest__.py index 59542e19e..ab13add7a 100644 --- a/web_editor_media_dialog_dms/__manifest__.py +++ b/web_editor_media_dialog_dms/__manifest__.py @@ -4,13 +4,13 @@ { "name": "Web Editor Media Dialog DMS", "summary": "Integrate DMS with media dialog of web editor", - "version": "16.0.1.0.0", + "version": "18.0.1.0.0", "license": "AGPL-3", "author": "Tecnativa, Odoo Community Association (OCA)", "website": "https://github.com/OCA/dms", "depends": ["dms", "web_editor"], "assets": { - "web_editor.assets_media_dialog": [ + "html_editor.assets_media_dialog": [ "web_editor_media_dialog_dms/static/src/media_dialog/*", ] }, diff --git a/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.esm.js b/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.esm.js index a4352a85a..f2d100d4b 100644 --- a/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.esm.js +++ b/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.esm.js @@ -1,10 +1,11 @@ -/** @odoo-module */ - -import {SearchMedia} from "@web_editor/components/media_dialog/search_media"; +/* Copyright 2025 Carlos Roca - Tecnativa + * License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */ +import {Component, onWillStart, useRef, useState} from "@odoo/owl"; import {KeepLast} from "@web/core/utils/concurrency"; +import {SearchMedia} from "@web_editor/components/media_dialog/search_media"; +import {_t} from "@web/core/l10n/translation"; import {useDebounced} from "@web/core/utils/timing"; import {useService} from "@web/core/utils/hooks"; -import {Component, onWillStart, useRef, useState} from "@odoo/owl"; export class DMSFile extends Component {} DMSFile.template = "web_editor_media_dialog_dms.DMSFile"; @@ -22,7 +23,7 @@ export class DMSSelector extends Component { }); this.allowOpenPublic = false; this.NUMBER_OF_FILES_TO_DISPLAY = 30; - this.searchPlaceholder = this.env._t("Search a dms file"); + this.searchPlaceholder = _t("Search a dms file"); onWillStart(async () => { this.state.dmsFiles = await this.fetchFiles( this.NUMBER_OF_FILES_TO_DISPLAY, @@ -74,7 +75,7 @@ export class DMSSelector extends Component { if (this.selectInitialMedia()) { for (const file of files) { if ( - `/web/content/dms.file/${file.id}/content` === + `/mail/view?model=dms.file&res_id=${file.id}` === this.props.media.getAttribute("href").replace(/[?].*/, "") ) { this.selectFile(file); @@ -143,25 +144,20 @@ export class DMSSelector extends Component { return Promise.all( selectedMedia.map(async (file) => { const linkEl = document.createElement("a"); - let href = `/web/content/dms.file/${encodeURIComponent( + let href = `/mail/view?model=dms.file&res_id=${encodeURIComponent( file.id - )}/content`; + )}`; // Download svg images because are considered images but are not // visualized correctly on new tab. Other files than pdf or image are // downloaded by default - var extra_added = false; if (file.mimetype === "image/svg+xml") { - href += "?download=true"; - extra_added = true; + href += "&download=true"; } if (file.allowOpenPublic) { const accessToken = await orm.call("dms.file", "get_access_token", [ file.id, ]); - href += `${ - extra_added ? "&" : "?" - }access_token=${encodeURIComponent(accessToken)}`; - extra_added = true; + href += `&access_token=${encodeURIComponent(accessToken)}`; } linkEl.href = href; linkEl.title = file.name; diff --git a/web_editor_media_dialog_dms/static/src/media_dialog/media_dialog.esm.js b/web_editor_media_dialog_dms/static/src/media_dialog/media_dialog.esm.js index ebc67492a..b61fb5c5e 100644 --- a/web_editor_media_dialog_dms/static/src/media_dialog/media_dialog.esm.js +++ b/web_editor_media_dialog_dms/static/src/media_dialog/media_dialog.esm.js @@ -1,10 +1,10 @@ -/** @odoo-module **/ - -import {MediaDialog, TABS} from "@web_editor/components/media_dialog/media_dialog"; +/* Copyright 2025 Carlos Roca - Tecnativa + * License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). */ +import {MediaDialog, TABS} from "@html_editor/main/media/media_dialog/media_dialog"; import {DMSSelector} from "./dms_selector.esm"; import {patch} from "@web/core/utils/patch"; -patch(TABS, "web_editor_media_dialog_dms.TABS", { +patch(TABS, { DMS: { id: "DMS", title: "DMS", @@ -12,9 +12,9 @@ patch(TABS, "web_editor_media_dialog_dms.TABS", { }, }); -patch(MediaDialog.prototype, "web_editor_media_dialog_dms.MediaDialog", { +patch(MediaDialog.prototype, { get initialActiveTab() { - const dmsTab = this.tabs.find((tab) => tab.id === "DMS"); + const dmsTab = this.tabs.DMS; if ( !this.props.activeTab && dmsTab && @@ -23,10 +23,10 @@ patch(MediaDialog.prototype, "web_editor_media_dialog_dms.MediaDialog", { ) { return dmsTab.id; } - return this._super(...arguments); + return super.initialActiveTab; }, - addTabs() { - const res = this._super(...arguments); + addDefaultTabs() { + const res = super.addDefaultTabs(...arguments); const onlyImages = this.props.onlyImages || this.props.multiImages || From 9773ae8700dbf4837b898f36a84dc41d2b474648 Mon Sep 17 00:00:00 2001 From: oca-ci Date: Mon, 11 Aug 2025 06:14:07 +0000 Subject: [PATCH 08/18] [UPD] Update web_editor_media_dialog_dms.pot --- .../i18n/web_editor_media_dialog_dms.pot | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/web_editor_media_dialog_dms/i18n/web_editor_media_dialog_dms.pot b/web_editor_media_dialog_dms/i18n/web_editor_media_dialog_dms.pot index 81db41499..39e3ef22c 100644 --- a/web_editor_media_dialog_dms/i18n/web_editor_media_dialog_dms.pot +++ b/web_editor_media_dialog_dms/i18n/web_editor_media_dialog_dms.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 16.0\n" +"Project-Id-Version: Odoo Server 18.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" @@ -16,14 +16,12 @@ msgstr "" #. module: web_editor_media_dialog_dms #. odoo-javascript #: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 -#, python-format msgid "All DMS files have been loaded" msgstr "" #. module: web_editor_media_dialog_dms #. odoo-javascript #: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 -#, python-format msgid "Allow open to public users" msgstr "" @@ -40,27 +38,23 @@ msgstr "" #. module: web_editor_media_dialog_dms #. odoo-python #: code:addons/web_editor_media_dialog_dms/models/dms_file.py:0 -#, python-format msgid "Invalid access token" msgstr "" #. module: web_editor_media_dialog_dms #. odoo-javascript #: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 -#, python-format msgid "Load more..." msgstr "" #. module: web_editor_media_dialog_dms #. odoo-javascript #: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 -#, python-format msgid "No DMS files found." msgstr "" #. module: web_editor_media_dialog_dms #. odoo-javascript #: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.esm.js:0 -#, python-format msgid "Search a dms file" msgstr "" From 32d3c9dbafd55fcfe46e4e9d6c2c6fd0754aee20 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Mon, 11 Aug 2025 06:16:48 +0000 Subject: [PATCH 09/18] [BOT] post-merge updates --- web_editor_media_dialog_dms/README.rst | 8 ++++-- .../static/description/index.html | 28 +++++++++++-------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/web_editor_media_dialog_dms/README.rst b/web_editor_media_dialog_dms/README.rst index acead953d..594f18989 100644 --- a/web_editor_media_dialog_dms/README.rst +++ b/web_editor_media_dialog_dms/README.rst @@ -1,3 +1,7 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + =========================== Web Editor Media Dialog DMS =========================== @@ -7,13 +11,13 @@ Web Editor Media Dialog DMS !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:cc57658ce5d4b5187afb21e817001519e004eb3e2e10fa4e3897b5c9e3e3f129 + !! source digest: sha256:c68ef8ff8c8cf94eff5926dd085aa54169da4fc72822f2949fd4a4edcc874156 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |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 +.. |badge2| image:: https://img.shields.io/badge/license-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%2Fdms-lightgray.png?logo=github diff --git a/web_editor_media_dialog_dms/static/description/index.html b/web_editor_media_dialog_dms/static/description/index.html index 347b826c1..e6168ed1f 100644 --- a/web_editor_media_dialog_dms/static/description/index.html +++ b/web_editor_media_dialog_dms/static/description/index.html @@ -3,7 +3,7 @@ -Web Editor Media Dialog DMS +README.rst -
-

Web Editor Media Dialog DMS

+
+ + +Odoo Community Association + +
+

Web Editor Media Dialog DMS

-

Beta License: AGPL-3 OCA/dms Translate me on Weblate Try me on Runboat

+

Beta License: AGPL-3 OCA/dms Translate me on Weblate Try me on Runboat

This module adds the option in the web editor to include an image with the corresponding link to open/download the linked files.

Table of contents

@@ -386,7 +391,7 @@

Web Editor Media Dialog DMS

-

Usage

+

Usage

To use this module, we need:

  1. Navigate to a model that has an HTML field
  2. @@ -402,7 +407,7 @@

    Usage

    DMS tab of media dialog.

-

Bug Tracker

+

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 @@ -410,15 +415,15 @@

Bug Tracker

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

-

Credits

+

Credits

-

Authors

+

Authors

  • Tecnativa
-

Contributors

+

Contributors

-

Maintainers

+

Maintainers

This module is maintained by the OCA.

Odoo Community Association @@ -441,5 +446,6 @@

Maintainers

+
From d8d5b1955a6a5677fa1ec26e4af644409ef7f504 Mon Sep 17 00:00:00 2001 From: Laurence Lars Labusch Date: Thu, 4 Sep 2025 05:58:19 +0200 Subject: [PATCH 10/18] [FIX] web_editor_media_dialog_dms: Align method with core signature Aligns the overridden _find_record_check_access method with its updated signature in the Odoo core. This change ensures continued compatibility and proper access to DMS media files via access tokens. Key Changes: - Updates the method override to accept and pass the new 'field' parameter. --- web_editor_media_dialog_dms/models/ir_binary.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web_editor_media_dialog_dms/models/ir_binary.py b/web_editor_media_dialog_dms/models/ir_binary.py index 4ad8de485..b02c9b8b0 100644 --- a/web_editor_media_dialog_dms/models/ir_binary.py +++ b/web_editor_media_dialog_dms/models/ir_binary.py @@ -7,9 +7,9 @@ class IrBinary(models.AbstractModel): _inherit = "ir.binary" - def _find_record_check_access(self, record, access_token): + def _find_record_check_access(self, record, access_token, field=None): # The method is overridden to allow access to the media attached to the # dms.file records using an access_token. if record._name == "dms.file": return record.validate_access(access_token) - return super()._find_record_check_access(record, access_token) + return super()._find_record_check_access(record, access_token, field=field) From c1564a0d419598873a6c099c371b2f235c875967 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Fri, 5 Sep 2025 12:10:21 +0000 Subject: [PATCH 11/18] [BOT] post-merge updates --- web_editor_media_dialog_dms/README.rst | 2 +- web_editor_media_dialog_dms/__manifest__.py | 2 +- web_editor_media_dialog_dms/static/description/index.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web_editor_media_dialog_dms/README.rst b/web_editor_media_dialog_dms/README.rst index 594f18989..92cb672dd 100644 --- a/web_editor_media_dialog_dms/README.rst +++ b/web_editor_media_dialog_dms/README.rst @@ -11,7 +11,7 @@ Web Editor Media Dialog DMS !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:c68ef8ff8c8cf94eff5926dd085aa54169da4fc72822f2949fd4a4edcc874156 + !! source digest: sha256:69ef360f611a9faaf1e4bb82d63b18c7a0b57133c2a7057ab6b2ef0309333755 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/web_editor_media_dialog_dms/__manifest__.py b/web_editor_media_dialog_dms/__manifest__.py index ab13add7a..e6ed76560 100644 --- a/web_editor_media_dialog_dms/__manifest__.py +++ b/web_editor_media_dialog_dms/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Web Editor Media Dialog DMS", "summary": "Integrate DMS with media dialog of web editor", - "version": "18.0.1.0.0", + "version": "18.0.1.0.1", "license": "AGPL-3", "author": "Tecnativa, Odoo Community Association (OCA)", "website": "https://github.com/OCA/dms", diff --git a/web_editor_media_dialog_dms/static/description/index.html b/web_editor_media_dialog_dms/static/description/index.html index e6168ed1f..7e9af0672 100644 --- a/web_editor_media_dialog_dms/static/description/index.html +++ b/web_editor_media_dialog_dms/static/description/index.html @@ -372,7 +372,7 @@

Web Editor Media Dialog DMS

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:c68ef8ff8c8cf94eff5926dd085aa54169da4fc72822f2949fd4a4edcc874156 +!! source digest: sha256:69ef360f611a9faaf1e4bb82d63b18c7a0b57133c2a7057ab6b2ef0309333755 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Beta License: AGPL-3 OCA/dms Translate me on Weblate Try me on Runboat

This module adds the option in the web editor to include an image with From cc05be3c1b93627cf3bf522d267339c9b112fa81 Mon Sep 17 00:00:00 2001 From: jakobkrabbe Date: Fri, 19 Sep 2025 13:31:36 +0000 Subject: [PATCH 12/18] Added translation using Weblate (Swedish) --- web_editor_media_dialog_dms/i18n/sv.po | 61 ++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 web_editor_media_dialog_dms/i18n/sv.po diff --git a/web_editor_media_dialog_dms/i18n/sv.po b/web_editor_media_dialog_dms/i18n/sv.po new file mode 100644 index 000000000..b2373e7a2 --- /dev/null +++ b/web_editor_media_dialog_dms/i18n/sv.po @@ -0,0 +1,61 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_editor_media_dialog_dms +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: sv\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" + +#. module: web_editor_media_dialog_dms +#. odoo-javascript +#: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 +msgid "All DMS files have been loaded" +msgstr "" + +#. module: web_editor_media_dialog_dms +#. odoo-javascript +#: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 +msgid "Allow open to public users" +msgstr "" + +#. module: web_editor_media_dialog_dms +#: model:ir.model,name:web_editor_media_dialog_dms.model_dms_file +msgid "File" +msgstr "" + +#. module: web_editor_media_dialog_dms +#: model:ir.model,name:web_editor_media_dialog_dms.model_ir_binary +msgid "File streaming helper model for controllers" +msgstr "" + +#. module: web_editor_media_dialog_dms +#. odoo-python +#: code:addons/web_editor_media_dialog_dms/models/dms_file.py:0 +msgid "Invalid access token" +msgstr "" + +#. module: web_editor_media_dialog_dms +#. odoo-javascript +#: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 +msgid "Load more..." +msgstr "" + +#. module: web_editor_media_dialog_dms +#. odoo-javascript +#: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 +msgid "No DMS files found." +msgstr "" + +#. module: web_editor_media_dialog_dms +#. odoo-javascript +#: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.esm.js:0 +msgid "Search a dms file" +msgstr "" From e9c9a28e7d8653ff196a7abd42c55c8a68863599 Mon Sep 17 00:00:00 2001 From: jakobkrabbe Date: Fri, 19 Sep 2025 13:32:07 +0000 Subject: [PATCH 13/18] Translated using Weblate (Swedish) Currently translated at 100.0% (8 of 8 strings) Translation: dms-18.0/dms-18.0-web_editor_media_dialog_dms Translate-URL: https://translation.odoo-community.org/projects/dms-18-0/dms-18-0-web_editor_media_dialog_dms/sv/ --- web_editor_media_dialog_dms/i18n/sv.po | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/web_editor_media_dialog_dms/i18n/sv.po b/web_editor_media_dialog_dms/i18n/sv.po index b2373e7a2..73eb5d6d5 100644 --- a/web_editor_media_dialog_dms/i18n/sv.po +++ b/web_editor_media_dialog_dms/i18n/sv.po @@ -6,56 +6,58 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 18.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2025-09-19 13:34+0000\n" +"Last-Translator: jakobkrabbe \n" "Language-Team: none\n" "Language: sv\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.10.4\n" #. module: web_editor_media_dialog_dms #. odoo-javascript #: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 msgid "All DMS files have been loaded" -msgstr "" +msgstr "Alla DMS-filer har laddats" #. module: web_editor_media_dialog_dms #. odoo-javascript #: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 msgid "Allow open to public users" -msgstr "" +msgstr "Tillåt öppen för offentliga användare" #. module: web_editor_media_dialog_dms #: model:ir.model,name:web_editor_media_dialog_dms.model_dms_file msgid "File" -msgstr "" +msgstr "Fil" #. module: web_editor_media_dialog_dms #: model:ir.model,name:web_editor_media_dialog_dms.model_ir_binary msgid "File streaming helper model for controllers" -msgstr "" +msgstr "Hjälpmodell för filströmning för styrenheter" #. module: web_editor_media_dialog_dms #. odoo-python #: code:addons/web_editor_media_dialog_dms/models/dms_file.py:0 msgid "Invalid access token" -msgstr "" +msgstr "Ogiltig åtkomsttoken" #. module: web_editor_media_dialog_dms #. odoo-javascript #: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 msgid "Load more..." -msgstr "" +msgstr "Ladda mer..." #. module: web_editor_media_dialog_dms #. odoo-javascript #: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 msgid "No DMS files found." -msgstr "" +msgstr "Inga DMS-filer hittade." #. module: web_editor_media_dialog_dms #. odoo-javascript #: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.esm.js:0 msgid "Search a dms file" -msgstr "" +msgstr "Sök i en dms-fil" From ce38406cc7c1ed0db41fedd0d20efa44095e6c10 Mon Sep 17 00:00:00 2001 From: Mohamed Essam Salem Date: Thu, 14 May 2026 22:41:36 +0000 Subject: [PATCH 14/18] Added translation using Weblate (Arabic) --- web_editor_media_dialog_dms/i18n/ar.po | 62 ++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 web_editor_media_dialog_dms/i18n/ar.po diff --git a/web_editor_media_dialog_dms/i18n/ar.po b/web_editor_media_dialog_dms/i18n/ar.po new file mode 100644 index 000000000..f01c85627 --- /dev/null +++ b/web_editor_media_dialog_dms/i18n/ar.po @@ -0,0 +1,62 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_editor_media_dialog_dms +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: ar\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " +"&& n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n" + +#. module: web_editor_media_dialog_dms +#. odoo-javascript +#: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 +msgid "All DMS files have been loaded" +msgstr "" + +#. module: web_editor_media_dialog_dms +#. odoo-javascript +#: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 +msgid "Allow open to public users" +msgstr "" + +#. module: web_editor_media_dialog_dms +#: model:ir.model,name:web_editor_media_dialog_dms.model_dms_file +msgid "File" +msgstr "" + +#. module: web_editor_media_dialog_dms +#: model:ir.model,name:web_editor_media_dialog_dms.model_ir_binary +msgid "File streaming helper model for controllers" +msgstr "" + +#. module: web_editor_media_dialog_dms +#. odoo-python +#: code:addons/web_editor_media_dialog_dms/models/dms_file.py:0 +msgid "Invalid access token" +msgstr "" + +#. module: web_editor_media_dialog_dms +#. odoo-javascript +#: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 +msgid "Load more..." +msgstr "" + +#. module: web_editor_media_dialog_dms +#. odoo-javascript +#: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 +msgid "No DMS files found." +msgstr "" + +#. module: web_editor_media_dialog_dms +#. odoo-javascript +#: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.esm.js:0 +msgid "Search a dms file" +msgstr "" From c896aea4fff3ff3b95bda1f990677070eca3e99f Mon Sep 17 00:00:00 2001 From: Matjaz Mozetic Date: Mon, 22 Jun 2026 09:05:14 +0000 Subject: [PATCH 15/18] Added translation using Weblate (Slovenian) --- web_editor_media_dialog_dms/i18n/sl.po | 62 ++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 web_editor_media_dialog_dms/i18n/sl.po diff --git a/web_editor_media_dialog_dms/i18n/sl.po b/web_editor_media_dialog_dms/i18n/sl.po new file mode 100644 index 000000000..692e22061 --- /dev/null +++ b/web_editor_media_dialog_dms/i18n/sl.po @@ -0,0 +1,62 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_editor_media_dialog_dms +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: sl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || " +"n%100==4 ? 2 : 3;\n" + +#. module: web_editor_media_dialog_dms +#. odoo-javascript +#: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 +msgid "All DMS files have been loaded" +msgstr "" + +#. module: web_editor_media_dialog_dms +#. odoo-javascript +#: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 +msgid "Allow open to public users" +msgstr "" + +#. module: web_editor_media_dialog_dms +#: model:ir.model,name:web_editor_media_dialog_dms.model_dms_file +msgid "File" +msgstr "" + +#. module: web_editor_media_dialog_dms +#: model:ir.model,name:web_editor_media_dialog_dms.model_ir_binary +msgid "File streaming helper model for controllers" +msgstr "" + +#. module: web_editor_media_dialog_dms +#. odoo-python +#: code:addons/web_editor_media_dialog_dms/models/dms_file.py:0 +msgid "Invalid access token" +msgstr "" + +#. module: web_editor_media_dialog_dms +#. odoo-javascript +#: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 +msgid "Load more..." +msgstr "" + +#. module: web_editor_media_dialog_dms +#. odoo-javascript +#: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 +msgid "No DMS files found." +msgstr "" + +#. module: web_editor_media_dialog_dms +#. odoo-javascript +#: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.esm.js:0 +msgid "Search a dms file" +msgstr "" From ca41f837b7541198320cba7ca77add117b1eb837 Mon Sep 17 00:00:00 2001 From: Matjaz Mozetic Date: Mon, 22 Jun 2026 09:07:53 +0000 Subject: [PATCH 16/18] Translated using Weblate (Slovenian) Currently translated at 100.0% (8 of 8 strings) Translation: dms-18.0/dms-18.0-web_editor_media_dialog_dms Translate-URL: https://translation.odoo-community.org/projects/dms-18-0/dms-18-0-web_editor_media_dialog_dms/sl/ --- web_editor_media_dialog_dms/i18n/sl.po | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/web_editor_media_dialog_dms/i18n/sl.po b/web_editor_media_dialog_dms/i18n/sl.po index 692e22061..3a6e9bb2f 100644 --- a/web_editor_media_dialog_dms/i18n/sl.po +++ b/web_editor_media_dialog_dms/i18n/sl.po @@ -6,7 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 18.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2026-06-22 09:08+0000\n" +"Last-Translator: Matjaz Mozetic \n" "Language-Team: none\n" "Language: sl\n" "MIME-Version: 1.0\n" @@ -14,49 +15,50 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || " "n%100==4 ? 2 : 3;\n" +"X-Generator: Weblate 5.15.2\n" #. module: web_editor_media_dialog_dms #. odoo-javascript #: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 msgid "All DMS files have been loaded" -msgstr "" +msgstr "Vse datoteke DMS so naložene" #. module: web_editor_media_dialog_dms #. odoo-javascript #: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 msgid "Allow open to public users" -msgstr "" +msgstr "Dovoli odpiranje javnim uporabnikom" #. module: web_editor_media_dialog_dms #: model:ir.model,name:web_editor_media_dialog_dms.model_dms_file msgid "File" -msgstr "" +msgstr "Datoteka" #. module: web_editor_media_dialog_dms #: model:ir.model,name:web_editor_media_dialog_dms.model_ir_binary msgid "File streaming helper model for controllers" -msgstr "" +msgstr "Pomožni model za pretakanje datotek za kontrolerje" #. module: web_editor_media_dialog_dms #. odoo-python #: code:addons/web_editor_media_dialog_dms/models/dms_file.py:0 msgid "Invalid access token" -msgstr "" +msgstr "Neveljaven dostopni žeton" #. module: web_editor_media_dialog_dms #. odoo-javascript #: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 msgid "Load more..." -msgstr "" +msgstr "Naloži več..." #. module: web_editor_media_dialog_dms #. odoo-javascript #: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.xml:0 msgid "No DMS files found." -msgstr "" +msgstr "Ni najdenih DMS datotek." #. module: web_editor_media_dialog_dms #. odoo-javascript #: code:addons/web_editor_media_dialog_dms/static/src/media_dialog/dms_selector.esm.js:0 msgid "Search a dms file" -msgstr "" +msgstr "Iskanje DMS datoteke" From d9a3c6338faf5c3a28ba6d283094a8202f8817d6 Mon Sep 17 00:00:00 2001 From: mmircoli-nexapp Date: Mon, 22 Jun 2026 16:52:40 +0200 Subject: [PATCH 17/18] [MIG] web_editor_media_dialog_dms: Migration to 19.0 --- web_editor_media_dialog_dms/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_editor_media_dialog_dms/__manifest__.py b/web_editor_media_dialog_dms/__manifest__.py index e6ed76560..f532cca57 100644 --- a/web_editor_media_dialog_dms/__manifest__.py +++ b/web_editor_media_dialog_dms/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Web Editor Media Dialog DMS", "summary": "Integrate DMS with media dialog of web editor", - "version": "18.0.1.0.1", + "version": "19.0.1.0.0", "license": "AGPL-3", "author": "Tecnativa, Odoo Community Association (OCA)", "website": "https://github.com/OCA/dms", From 6ac67fbbaa837d84e45a8784b4b08381754855a8 Mon Sep 17 00:00:00 2001 From: mmircoli-nexapp Date: Mon, 22 Jun 2026 17:08:21 +0200 Subject: [PATCH 18/18] [IMP] web_editor_media_dialog_dms: use self.env._ for translations --- web_editor_media_dialog_dms/models/dms_file.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web_editor_media_dialog_dms/models/dms_file.py b/web_editor_media_dialog_dms/models/dms_file.py index 3b6d4447a..f0b1f8499 100644 --- a/web_editor_media_dialog_dms/models/dms_file.py +++ b/web_editor_media_dialog_dms/models/dms_file.py @@ -1,7 +1,7 @@ # Copyright 2024 Tecnativa - Carlos Roca # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). -from odoo import _, models +from odoo import models from odoo.exceptions import AccessError from odoo.tools import consteq @@ -21,6 +21,6 @@ def validate_access(self, access_token): tok = record_sudo.with_context(prefetch_fields=False).access_token valid_token = consteq(tok or "", access_token) if not valid_token: - raise AccessError(_("Invalid access token")) + raise AccessError(self.env._("Invalid access token")) return record_sudo return self