odoo-modules/odoo-bringout-eurooffice-eurooffice_odoo/eurooffice_odoo/utils/format_utils.py
Ernad Husremovic b59a9dc6bb 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.
2026-03-31 17:24:17 +02:00

42 lines
968 B
Python

#
# (c) Copyright Ascensio System SIA 2024
#
import json
import os
class Format:
def __init__(self, name, type, actions=None, convert=None, mime=None):
if actions is None:
actions = []
if convert is None:
convert = []
if mime is None:
mime = []
self.name = name
self.type = type
self.actions = actions
self.convert = convert
self.mime = mime
def get_supported_formats():
file_path = os.path.join(
os.path.dirname(__file__), "..", "static", "assets", "document_formats", "eurooffice-docs-formats.json"
)
with open(file_path, encoding="utf-8") as f:
data = json.load(f)
formats = []
for item in data:
n = item["name"]
t = item["type"]
a = item.get("actions", [])
c = item.get("convert", [])
m = item.get("mime", [])
formats.append(Format(n, t, a, c, m))
return formats