init: Euro-Office Odoo 16.0 modules

Based on onlyoffice_odoo by Ascensio System SIA (ONLYOFFICE, LGPL-3).
Rebranded and adapted for Euro-Office by bring.out d.o.o.

Modules:
- eurooffice_odoo: base integration
- eurooffice_odoo_templates: document templates
- eurooffice_odoo_oca_dms: OCA DMS integration (replaces Enterprise documents)

All references renamed: onlyoffice -> eurooffice, ONLYOFFICE -> Euro-Office.
Original copyright notices preserved.
This commit is contained in:
Ernad Husremovic 2026-03-31 17:24:17 +02:00
commit b59a9dc6bb
347 changed files with 16699 additions and 0 deletions

View file

@ -0,0 +1,2 @@
from . import models
from . import controllers

View file

@ -0,0 +1,44 @@
# Based on onlyoffice_odoo by Ascensio System SIA (ONLYOFFICE)
# Rebranded for Euro-Office by bring.out d.o.o.
# (c) Copyright Ascensio System SIA 2024 - original eurooffice_odoo_documents
# Copyright 2026 bring.out d.o.o. - OCA DMS adaptation
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
#
# Based on eurooffice_odoo_documents by Euro-Office (LGPL-3):
# https://github.com/Euro-Office/eurooffice_odoo/tree/16.0/eurooffice_odoo_documents
# The original module depends on Odoo Enterprise 'documents' module.
# This adaptation replaces that dependency with OCA DMS (dms),
# the open-source Document Management System from the Odoo Community Association.
{
"name": "Euro-Office DMS",
"summary": "Edit and collaborate on office files within OCA DMS.",
"description": """
Based on eurooffice_odoo_documents by Euro-Office (Ascensio System SIA).
This module adapts the original Euro-Office Documents integration to work
with OCA DMS (dms) instead of the proprietary Odoo Enterprise 'documents'
module. It provides the same functionality: edit and collaborate on office
files stored in OCA Document Management System using Euro-Office/Euro-Office
Docs, with real-time co-editing support.
Original: https://github.com/Euro-Office/eurooffice_odoo
""",
"author": "Euro-Office, bring.out d.o.o.",
"website": "https://www.bring.out.ba",
"category": "Document Management",
"version": "16.0.1.0.0",
"depends": ["eurooffice_odoo", "dms"],
"external_dependencies": {"python": ["pyjwt"]},
"data": [
"security/ir.model.access.csv",
],
"license": "LGPL-3",
"installable": True,
"application": False,
"assets": {
"web.assets_backend": [
"eurooffice_odoo_oca_dms/static/src/dms_view/**/*",
"eurooffice_odoo_oca_dms/static/src/components/*/*.xml",
],
},
}

View file

@ -0,0 +1 @@
from . import controllers

View file

@ -0,0 +1,104 @@
#
# (c) Copyright Ascensio System SIA 2024 - original eurooffice_odoo_documents
# Copyright 2026 bring.out d.o.o. - OCA DMS adaptation
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
#
# Based on eurooffice_odoo_documents/controllers/controllers.py
# Adapted to use dms.file instead of documents.document
#
import json
import logging
import requests
from werkzeug.exceptions import Forbidden
from odoo import http
from odoo.exceptions import AccessError
from odoo.http import request
from odoo.tools.translate import _
from odoo.addons.eurooffice_odoo.controllers.controllers import Eurooffice_Connector
from odoo.addons.eurooffice_odoo.utils import file_utils
_logger = logging.getLogger(__name__)
class EuroofficeDms_Connector(http.Controller):
@http.route("/eurooffice/dms/file/create", auth="user", methods=["POST"], type="json")
def post_file_create(self, directory_id, supported_format, title, url=None):
result = {"error": None, "file_id": None}
try:
_logger.info(f"Getting new file template {request.env.user.lang} {supported_format}")
if url:
response = requests.get(url, stream=True, timeout=30)
response.raise_for_status()
file_data = response.content
else:
file_data = file_utils.get_default_file_template(
request.env.user.lang, supported_format
)
import base64
dms_file = request.env["dms.file"].create({
"name": title + "." + supported_format,
"directory_id": int(directory_id),
"content": base64.b64encode(file_data),
})
request.env["eurooffice.dms.access"].create({
"file_id": dms_file.id,
"internal_users": "none",
"link_access": "viewer",
})
request.env["eurooffice.dms.access.user"].create({
"file_id": dms_file.id,
"user_id": request.env.user.id,
"role": "editor",
})
result["file_id"] = dms_file.id
except Exception as ex:
_logger.exception(f"Failed to create DMS file {str(ex)}")
result["error"] = _("Failed to create document")
return json.dumps(result)
class EuroofficeDms_Inherited_Connector(Eurooffice_Connector):
@http.route(
"/eurooffice/editor/dms/<int:file_id>",
auth="public", type="http", website=True,
)
def render_dms_editor(self, file_id, access_token=None):
return request.render(
"eurooffice_odoo.eurooffice_editor",
self.prepare_dms_editor(file_id, access_token),
)
def prepare_dms_editor(self, file_id, access_token):
dms_file = request.env["dms.file"].browse(int(file_id))
try:
dms_file.check_access_rule("read")
except AccessError:
_logger.error("User has no read access to this DMS file")
raise Forbidden()
# DMS files store content as ir.attachment
attachment = dms_file.attachment_id
if not attachment:
_logger.error("DMS file has no attachment")
raise Forbidden()
attachment_record = self.get_attachment(attachment.id)
if not attachment_record:
raise Forbidden()
try:
dms_file.check_access_rule("write")
return self.prepare_editor_values(attachment_record, access_token, True)
except AccessError:
return self.prepare_editor_values(attachment_record, access_token, False)

View file

@ -0,0 +1,4 @@
from . import dms_file
from . import ir_attachment
from . import eurooffice_dms_access
from . import eurooffice_dms_access_user

View file

@ -0,0 +1,17 @@
# (c) Copyright Ascensio System SIA 2024
# Copyright 2026 bring.out d.o.o.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
# Adapted from eurooffice_odoo_documents for OCA DMS
from odoo import api, models
class DmsFile(models.Model):
_inherit = "dms.file"
@api.depends("content")
def _compute_thumbnail(self):
super()._compute_thumbnail()
for record in self:
if record.mimetype == "application/pdf":
record.thumbnail = False

View file

@ -0,0 +1,39 @@
# (c) Copyright Ascensio System SIA 2024
# Copyright 2026 bring.out d.o.o.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
# Adapted from eurooffice_odoo_documents for OCA DMS
from odoo import _, fields, models
class EuroofficeDmsAccess(models.Model):
_name = "eurooffice.dms.access"
_description = "Euro-Office DMS Access"
file_id = fields.Many2one("dms.file", required=True, ondelete="cascade")
internal_users = fields.Selection(
[
("none", _("None")),
("viewer", _("Viewer")),
("commenter", _("Commenter")),
("reviewer", _("Reviewer")),
("editor", _("Editor")),
("form_filling", _("Form Filling")),
("custom_filter", _("Custom Filter")),
],
default="none",
string="Internal Users Access",
)
link_access = fields.Selection(
[
("none", _("None")),
("viewer", _("Viewer")),
("commenter", _("Commenter")),
("reviewer", _("Reviewer")),
("editor", _("Editor")),
("form_filling", _("Form Filling")),
("custom_filter", _("Custom Filter")),
],
default="viewer",
string="Link Access",
)

View file

@ -0,0 +1,27 @@
# (c) Copyright Ascensio System SIA 2024
# Copyright 2026 bring.out d.o.o.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
# Adapted from eurooffice_odoo_documents (Euro-Office, LGPL-3)
from odoo import _, fields, models
class EuroofficeDmsAccessUser(models.Model):
_name = "eurooffice.dms.access.user"
_description = "Euro-Office DMS Access Users"
file_id = fields.Many2one("dms.file", required=True, ondelete="cascade")
user_id = fields.Many2one("res.users", required=True, string="User")
role = fields.Selection(
[
("none", _("None")),
("viewer", _("Viewer")),
("commenter", _("Commenter")),
("reviewer", _("Reviewer")),
("editor", _("Editor")),
("form_filling", _("Form Filling")),
("custom_filter", _("Custom Filter")),
],
required=True,
string="Access Level",
)

View file

@ -0,0 +1,11 @@
# (c) Copyright Ascensio System SIA 2024
# Copyright 2026 bring.out d.o.o.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
# Adapted from eurooffice_odoo_documents for OCA DMS
from odoo import fields, models
class Attachment(models.Model):
_inherit = "ir.attachment"
oo_attachment_version = fields.Integer(default=1)

View file

@ -0,0 +1,3 @@
id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink
access_eurooffice_dms_access,eurooffice.dms.access,model_eurooffice_dms_access,base.group_user,1,1,1,1
access_eurooffice_dms_access_user,eurooffice.dms.access.user,model_eurooffice_dms_access_user,base.group_user,1,1,1,1
1 id name model_id/id group_id/id perm_read perm_write perm_create perm_unlink
2 access_eurooffice_dms_access eurooffice.dms.access model_eurooffice_dms_access base.group_user 1 1 1 1
3 access_eurooffice_dms_access_user eurooffice.dms.access.user model_eurooffice_dms_access_user base.group_user 1 1 1 1

View file

@ -0,0 +1,33 @@
[project]
name = "odoo-bringout-eurooffice-eurooffice_odoo_oca_dms"
version = "16.0.1.0.0"
description = "Euro-Office/Euro-Office integration with OCA DMS (open source alternative to Odoo Enterprise Documents)"
authors = [
{ name = "Ernad Husremovic", email = "hernad@bring.out.ba" }
]
dependencies = [
"pyjwt>=2.0.0"
]
readme = "README.md"
requires-python = ">= 3.11"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Programming Language :: Python :: 3",
"Topic :: Office/Business",
]
[project.urls]
homepage = "https://www.bring.out.ba"
repository = "https://github.com/bringout/0"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build.targets.wheel]
packages = ["eurooffice_odoo_oca_dms"]