Skip to content

Commit

Permalink
Merge pull request #68 from ONLYOFFICE/feature/17.0
Browse files Browse the repository at this point in the history
release for odoo v17
  • Loading branch information
LinneyS authored Jul 25, 2024
2 parents 72e00dc + 10cf43f commit 0c6dd17
Show file tree
Hide file tree
Showing 184 changed files with 6,523 additions and 142 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG documents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Change Log

## 4.0.1
## Changed
- replace docxf with pdf as a form template

## 2.0.1
## Added
- support Documents module
- opening file from Documents module
- creating file in Document module

## 1.0.0
## Added
- edit option for DOCX, DOCXF, XLSX, PPTX
- view option for DJVU, DOC, DOCM, DOT, DOTM, DOTX, EPUB, FB2, FODT, HTML, MHT, ODT, OFORM, OTT, OXPS, PDF, RTF, TXT, XPS, XML, CSV, FODS, ODS, OTS, XLS, XLSB, XLSM, XLT, XLTM, XLTX, FODP, ODP, OTP, POT, POTM, POTX, PPS, PPSM, PPSX, PPT, PPTM
- collaboration editing
- Translations for DE, EN, ES, FR, IT, PT-BR, RU, ZH-CN
8 changes: 8 additions & 0 deletions CHANGELOG templates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Change Log

## 2.0.2
## Added
- new templates module
- creating and editing templates in editor
- print with template
- access rights to templates module
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
# Change Log

## 4.0.0
## Added
- advanced server settings for specifying internal addresses
- validation of server settings on the settings page
- trial period of 30 days for the demo server
- link to docs cloud

## Changed
- replace docxf with pdf as a form template

## 2.1.0
## Added
- compatible with Odoo 17

## 2.0.0
## Added
- support Documents module
- opening file from Documents module
- creating file in Document module

## 1.0.0
## Added
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ The app allows to:

Supported formats:

* For editing: DOCX, DOCXF, XLSX, PPTX.
* For viewing: DJVU, DOC, DOCM, DOT, DOTM, DOTX, EPUB, FB2, FODT, HTML, MHT, ODT, OFORM, OTT, OXPS, PDF, RTF, TXT, XPS, XML, CSV, FODS, ODS, OTS, XLS, XLSB, XLSM, XLT, XLTM, XLTX, FODP, ODP, OTP, POT, POTM, POTX, PPS, PPSM, PPSX, PPT, PPTM.
* For editing: DOCX, XLSX, PPTX, PDF.
* For viewing: DJVU, DOC, DOCM, DOCXF, DOT, DOTM, DOTX, EPUB, FB2, FODT, HTML, MHT, ODT, OFORM, OTT, OXPS, RTF, TXT, XPS, XML, CSV, FODS, ODS, OTS, XLS, XLSB, XLSM, XLT, XLTM, XLTX, FODP, ODP, OTP, POT, POTM, POTX, PPS, PPSM, PPSX, PPT, PPTM.

## Installing ONLYOFFICE Docs

Expand Down
2 changes: 1 addition & 1 deletion onlyoffice_odoo/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
'website': "https://www.onlyoffice.com",

'category': 'Productivity',
'version': '2.1.0',
'version': '4.0.0',

'depends': ['base', 'mail'],

Expand Down
25 changes: 22 additions & 3 deletions onlyoffice_odoo/controllers/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
import logging
import markupsafe
import re
import string

from odoo import http
from odoo.http import request

from odoo.addons.onlyoffice_odoo.utils import file_utils
from odoo.addons.onlyoffice_odoo.utils import jwt_utils
from odoo.addons.onlyoffice_odoo.utils import config_utils
from odoo.addons.onlyoffice_odoo.utils import url_utils

from mimetypes import guess_type
from urllib.request import urlopen
Expand All @@ -24,6 +26,17 @@


class Onlyoffice_Connector(http.Controller):
@http.route("/onlyoffice/file/content/test.txt", auth="public")
def get_test_file(self):
content = "test"
headers = [
("Content-Length", len(content)),
("Content-Type", "text/plain"),
("Content-Disposition", "attachment; filename=test.txt")
]
response = request.make_response(content, headers)
return response

@http.route("/onlyoffice/file/content/<int:attachment_id>", auth="public")
def get_file_content(self, attachment_id, oo_security_token=None, access_token=None):

Expand Down Expand Up @@ -102,7 +115,7 @@ def editor_callback(self, attachment_id, oo_security_token=None, access_token=No
status = body["status"]

if (status == 2) | (status == 3): # mustsave, corrupted
file_url = body.get("url")
file_url = url_utils.replace_public_url_to_internal(request.env, body.get("url"))
attachment.write({"raw": urlopen(file_url).read(), "mimetype": guess_type(file_url)[0]})

except Exception as ex:
Expand All @@ -119,9 +132,9 @@ def prepare_editor_values(self, attachment, access_token, can_write):
data = attachment.read(["id", "checksum", "public", "name", "access_token"])[0]

docserver_url = config_utils.get_doc_server_public_url(request.env)
odoo_url = config_utils.get_odoo_url(request.env)
odoo_url = config_utils.get_base_or_odoo_url(request.env)

filename = data["name"]
filename = self.filter_xss(data["name"])

security_token = jwt_utils.encode_payload(request.env, { "id": request.env.user.id }, config_utils.get_internal_jwt_secret(request.env))
path_part = str(data["id"]) + "?oo_security_token=" + security_token + ("&access_token=" + access_token if access_token else "")
Expand Down Expand Up @@ -175,3 +188,9 @@ def get_user_from_token(self, token):
user_id = jwt_utils.decode_token(request.env, token, config_utils.get_internal_jwt_secret(request.env))["id"]
user = request.env["res.users"].sudo().browse(user_id).exists().ensure_one()
return user

def filter_xss(self, text):
allowed_symbols = set(string.ascii_letters + string.digits + "_-.")
text = "".join(char for char in text if char in allowed_symbols)

return text
97 changes: 91 additions & 6 deletions onlyoffice_odoo/i18n/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,25 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0-20221116\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-02-14 10:14+0000\n"
"PO-Revision-Date: 2023-02-16 10:49+0300\n"
"POT-Creation-Date: 2024-07-03 08:14+0000\n"
"PO-Revision-Date: 2024-07-03 15:33+0300\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: de\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.2.2\n"
"X-Generator: Poedit 3.4.4\n"

#. module: onlyoffice_odoo
#: model_terms:ir.ui.view,arch_db:onlyoffice_odoo.res_config_settings_view_form
msgid ""
"<span class=\"o_form_label\">Document Editing Service address for internal "
"requests from the server</span>"
msgstr ""
"<span class=\"o_form_label\">Adresse des Document Editing Service für "
"interne Anfragen vom Server</span>"

#. module: onlyoffice_odoo
#: model_terms:ir.ui.view,arch_db:onlyoffice_odoo.res_config_settings_view_form
Expand All @@ -25,18 +34,39 @@ msgstr "<span class=\"o_form_label\">JWT-Header von Document Server</span>"
#. module: onlyoffice_odoo
#: model_terms:ir.ui.view,arch_db:onlyoffice_odoo.res_config_settings_view_form
msgid "<span class=\"o_form_label\">Document Server JWT Secret</span>"
msgstr "<span class=\"o_form_label\">JWT-Geheimschlüssel von Document Server</span>"
msgstr ""
"<span class=\"o_form_label\">JWT-Geheimschlüssel von Document Server</span>"

#. module: onlyoffice_odoo
#: model_terms:ir.ui.view,arch_db:onlyoffice_odoo.res_config_settings_view_form
msgid "<span class=\"o_form_label\">Document Server Url</span>"
msgstr "<span class=\"o_form_label\">URL von Document Server</span>"

#. module: onlyoffice_odoo
#: model_terms:ir.ui.view,arch_db:onlyoffice_odoo.res_config_settings_view_form
msgid ""
"<span class=\"o_form_label\">Server address for internal requests from the "
"Document Editing Service</span>"
msgstr ""
"<span class=\"o_form_label\">Serveradresse für interne Anfragen des Document "
"Editing Service</span>"

#. module: onlyoffice_odoo
#: model:ir.model,name:onlyoffice_odoo.model_res_config_settings
msgid "Config Settings"
msgstr "Konfigurationseinstellungen"

#. module: onlyoffice_odoo
#: model:ir.model.fields,field_description:onlyoffice_odoo.field_res_config_settings__doc_server_demo
#: model_terms:ir.ui.view,arch_db:onlyoffice_odoo.res_config_settings_view_form
msgid "Connect to demo ONLYOFFICE Docs server"
msgstr "Zum Demoserver von ONLYOFFICE Docs verbinden"

#. module: onlyoffice_odoo
#: model:ir.model.fields,field_description:onlyoffice_odoo.field_res_config_settings__doc_server_inner_url
msgid "Document Server Inner URL"
msgstr "Innere URL von Document Server"

#. module: onlyoffice_odoo
#: model:ir.model.fields,field_description:onlyoffice_odoo.field_res_config_settings__doc_server_jwt_header
msgid "Document Server JWT Header"
Expand All @@ -49,8 +79,13 @@ msgstr "JWT-Geheimschlüssel von Document Server"

#. module: onlyoffice_odoo
#: model:ir.model.fields,field_description:onlyoffice_odoo.field_res_config_settings__doc_server_public_url
msgid "Document Server URL"
msgstr "URL von Document Server"
msgid "Document Server Public URL"
msgstr "Öffentliche URL von Document Server"

#. module: onlyoffice_odoo
#: model_terms:ir.ui.view,arch_db:onlyoffice_odoo.res_config_settings_view_form
msgid "GET NOW"
msgstr "JETZT ERHALTEN"

#. module: onlyoffice_odoo
#: model_terms:ir.ui.view,arch_db:onlyoffice_odoo.res_config_settings_view_form
Expand All @@ -67,13 +102,42 @@ msgstr "Interner JWT-Geheimschlüssel"
msgid "ONLYOFFICE"
msgstr "ONLYOFFICE"

#. module: onlyoffice_odoo
#. odoo-javascript
#: code:addons/onlyoffice_odoo/static/src/models/attachment_onlyoffice.js:0
#, python-format
msgid "ONLYOFFICE Docs server"
msgstr "ONLYOFFICE Docs-Server"

#. module: onlyoffice_odoo
#: model_terms:ir.ui.view,arch_db:onlyoffice_odoo.onlyoffice_editor
msgid "ONLYOFFICE cannot be reached. Please contact admin."
msgstr ""
"ONLYOFFICE kann nicht erreicht werden. Bitte kontaktieren Sie den "
"Administrator."

#. module: onlyoffice_odoo
#: model_terms:ir.ui.view,arch_db:onlyoffice_odoo.onlyoffice_editor
msgid "ONLYOFFICE logo"
msgstr "ONLYOFFICE-Logo"

#. module: onlyoffice_odoo
#: model:ir.model.fields,field_description:onlyoffice_odoo.field_res_config_settings__doc_server_odoo_url
msgid "Odoo URL"
msgstr "Odoo-URL"

#. module: onlyoffice_odoo
#. odoo-javascript
#: code:addons/onlyoffice_odoo/static/src/components/attachment_card_onlyoffice/attachment_card_onlyoffice.xml:0
#, python-format
msgid "Open in ONLYOFFICE"
msgstr "In ONLYOFFICE öffnen"

#. module: onlyoffice_odoo
#: model_terms:ir.ui.view,arch_db:onlyoffice_odoo.res_config_settings_view_form
msgid "Other"
msgstr "Andere"

#. module: onlyoffice_odoo
#: model_terms:ir.ui.view,arch_db:onlyoffice_odoo.res_config_settings_view_form
msgid "Security"
Expand All @@ -83,3 +147,24 @@ msgstr "Sicherheit"
#: model:ir.actions.act_window,name:onlyoffice_odoo.action_onlyoffice_config_settings
msgid "Settings"
msgstr "Einstellungen"

#. module: onlyoffice_odoo
#. odoo-javascript
#: code:addons/onlyoffice_odoo/static/src/models/attachment_onlyoffice.js:0
#, python-format
msgid ""
"The 30-day test period is over, you can no longer connect to demo ONLYOFFICE "
"Docs server"
msgstr ""
"Der 30-tägige Testzeitraum ist vorbei. Sie können sich nicht mehr mit dem "
"Demo-Server von ONLYOFFICE Docs verbinden"

#. module: onlyoffice_odoo
#: model_terms:ir.ui.view,arch_db:onlyoffice_odoo.res_config_settings_view_form
msgid ""
"This is a public test server, please do not use it for private sensitive "
"data. The server will be available during a 30-day period."
msgstr ""
"Dies ist ein öffentlicher Testserver, bitte verwenden Sie ihn nicht für "
"private sensible Daten. Der Server wird für einen Zeitraum von 30 Tagen "
"verfügbar sein."
Loading

0 comments on commit 0c6dd17

Please sign in to comment.