mirror of
https://github.com/bringout/euro-office.git
synced 2026-04-18 03:22:00 +02:00
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.
42 lines
968 B
Python
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
|