Skip to content

Commit

Permalink
Merge pull request #33 from ONLYOFFICE/17.0
Browse files Browse the repository at this point in the history
Release/2.1.0
  • Loading branch information
LinneyS authored Mar 4, 2024
2 parents 2b728a8 + 72e00dc commit 9f8d33a
Show file tree
Hide file tree
Showing 25 changed files with 129 additions and 197 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 2.1.0
## Added
- compatible with Odoo 17

## 2.0.0
## Added
- support Documents module
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,18 @@ The table below will help you make the right choice.
| Font and paragraph formatting | + | + |
| Object insertion | + | + |
| Transitions | + | + |
| Animations | + | + |
| Presenter mode | + | + |
| Notes | + | + |
| **Form creator features** | **Community Edition** | **Enterprise Edition** |
| Adding form fields | + | + |
| Form preview | + | + |
| Saving as PDF | + | + |
| **Working with PDF** | **Community Edition** | **Enterprise Edition** |
| Text annotations (highlight, underline, cross out) | + | + |
| Comments | + | + |
| Freehand drawings | + | + |
| Form filling | + | + |
| | [Get it now](https://www.onlyoffice.com/download-docs.aspx#docs-community) | [Start Free Trial](https://www.onlyoffice.com/download-docs.aspx#docs-enterprise) |

\* If supported by DMS.
Expand Down
6 changes: 2 additions & 4 deletions 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.0.0',
'version': '2.1.0',

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

Expand All @@ -31,11 +31,9 @@
'application': True,

'assets': {
'mail.assets_messaging': [
'onlyoffice_odoo/static/src/models/*.js',
],
'web.assets_backend': [
'onlyoffice_odoo/static/src/components/*/*.xml',
'onlyoffice_odoo/static/src/models/*.js'
],
},
}
2 changes: 1 addition & 1 deletion onlyoffice_odoo/controllers/controllers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-

#
# (c) Copyright Ascensio System SIA 2023
# (c) Copyright Ascensio System SIA 2024
#

import json
Expand Down
2 changes: 1 addition & 1 deletion onlyoffice_odoo/models/res_config_settings.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-

#
# (c) Copyright Ascensio System SIA 2023
# (c) Copyright Ascensio System SIA 2024
#

from odoo import fields, models, _
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>

<!-- -->
<!-- (c) Copyright Ascensio System SIA 2023 -->
<!-- (c) Copyright Ascensio System SIA 2024 -->
<!-- -->


<templates xml:space="preserve">
<t t-inherit="mail.AttachmentCard" t-inherit-mode="extension" owl="1">
<xpath expr="//div[hasclass('o_AttachmentCard_aside')]" position="before">
<t t-if="attachmentCard.showOnlyofficeButton">
<div class="o_AttachmentCard_aside position-relative overflow-hidden o-hasMultipleActions d-flex flex-column">
<button class="o_AttachmentCard_asideItem o_AttachmentCard_asideItemOnlyoffice btn top-0 justify-content-center align-items-center d-flex w-100 h-100 rounded-0 bg-300" t-on-click="attachmentCard.attachment.onClickOnlyofficeEdit" title="Open in ONLYOFFICE">
<img src="/onlyoffice_odoo/static/svg/edit.svg" role="img" aria-label="Open in ONLYOFFICE" />
</button>
</div>
</t>
<t t-inherit="mail.AttachmentList" t-inherit-mode="extension" owl="1">
<xpath expr="//div[hasclass('o-mail-AttachmentCard-aside')]" position="before">
<div class="o-mail-AttachmentCard-aside position-relative rounded-end overflow-hidden" t-att-class="{ 'o-hasMultipleActions d-flex flex-column': attachment.isDeletable and !env.inComposer }">
<button t-if="onlyofficeCanOpen(attachment)" t-on-click="() => this.openOnlyoffice(attachment)" class="btn d-flex justify-content-center align-items-center w-100 h-100 rounded-0" t-attf-class="bg-300">
<img src="/onlyoffice_odoo/static/svg/edit.svg" role="img" aria-label="Open in ONLYOFFICE" />
</button>
</div>
</xpath>
</t>
</templates>
72 changes: 61 additions & 11 deletions onlyoffice_odoo/static/src/models/attachment_card_onlyoffice.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,70 @@

/*
*
* (c) Copyright Ascensio System SIA 2023
* (c) Copyright Ascensio System SIA 2024
*
*/

import { registerPatch } from '@mail/model/model_core';
import { attr } from '@mail/model/model_field';
import { AttachmentList } from "@mail/core/common/attachment_list";
import { patch } from "@web/core/utils/patch";

registerPatch({
name: 'AttachmentCard',
fields: {
showOnlyofficeButton: attr({
compute() {
return this.attachment.onlyofficeCanEdit || this.attachment.onlyofficeCanView;
},
}),
const oo_editable_formats = [
"docx",
"docxf",
"xlsx",
"pptx",
]

const oo_viewable_formats = [
"djvu",
"doc",
"docm",
"dot",
"dotm",
"dotx",
"epub",
"fb2",
"fodt",
"html",
"mht",
"odt",
"ott",
"oxps",
"pdf",
"rtf",
"txt",
"xps",
"xml",
"oform",
"csv",
"fods",
"ods",
"ots",
"xls",
"xlsb",
"xlsm",
"xlt",
"xltm",
"xltx",
"fodp",
"odp",
"otp",
"pot",
"potm",
"potx",
"pps",
"ppsm",
"ppsx",
"ppt",
"pptm",
];

patch(AttachmentList.prototype, {
onlyofficeCanOpen(attachment) {
return oo_editable_formats.includes(attachment.extension) || oo_viewable_formats.includes(attachment.extension);
},
openOnlyoffice(attachment) {
const accessTokenQuery = attachment.accessToken ? `?access_token=${attachment.accessToken}` : '';
window.open(`/onlyoffice/editor/${attachment.id}${accessTokenQuery}`, '_blank');
}
});
93 changes: 0 additions & 93 deletions onlyoffice_odoo/static/src/models/attachment_onlyoffice.js

This file was deleted.

2 changes: 1 addition & 1 deletion onlyoffice_odoo/utils/config_constants.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# (c) Copyright Ascensio System SIA 2023
# (c) Copyright Ascensio System SIA 2024
#

DOC_SERVER_PUBLIC_URL = "onlyoffice_connector.doc_server_public_url"
Expand Down
2 changes: 1 addition & 1 deletion onlyoffice_odoo/utils/config_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# (c) Copyright Ascensio System SIA 2023
# (c) Copyright Ascensio System SIA 2024
#

import uuid
Expand Down
2 changes: 1 addition & 1 deletion onlyoffice_odoo/utils/file_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# (c) Copyright Ascensio System SIA 2023
# (c) Copyright Ascensio System SIA 2024
#

import os
Expand Down
2 changes: 1 addition & 1 deletion onlyoffice_odoo/utils/format_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# (c) Copyright Ascensio System SIA 2023
# (c) Copyright Ascensio System SIA 2024
#


Expand Down
2 changes: 1 addition & 1 deletion onlyoffice_odoo/utils/jwt_utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# (c) Copyright Ascensio System SIA 2023
# (c) Copyright Ascensio System SIA 2024
#

import jwt
Expand Down
63 changes: 17 additions & 46 deletions onlyoffice_odoo/views/res_config_settings_views.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>

<!-- -->
<!-- (c) Copyright Ascensio System SIA 2023 -->
<!-- (c) Copyright Ascensio System SIA 2024 -->
<!-- -->

<odoo>
Expand All @@ -11,51 +11,22 @@
<field name="priority" eval="10" />
<field name="inherit_id" ref="base.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath expr="//div[hasclass('settings')]" position="inside">
<div class="app_settings_block"
string="ONLYOFFICE"
data-string="ONLYOFFICE"
data-key="onlyoffice_odoo">
<div>
<h2>General Settings</h2>
<div class="row mt16 o_settings_container">
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane" />
<div class="o_setting_right_pane">
<span class="o_form_label">Document Server Url</span>
<div class="text-muted content-group mt16">
<field name="doc_server_public_url" />
</div>
</div>
</div>
</div>
</div>
<div>
<h2>Security</h2>
<div class="row mt16 o_settings_container">
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane" />
<div class="o_setting_right_pane">
<span class="o_form_label">Document Server JWT Secret</span>
<div class="text-muted content-group mt16">
<field name="doc_server_jwt_secret" />
</div>
</div>
</div>
</div>
<div class="row mt16 o_settings_container">
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane" />
<div class="o_setting_right_pane">
<span class="o_form_label">Document Server JWT Header</span>
<div class="text-muted content-group mt16">
<field name="doc_server_jwt_header" />
</div>
</div>
</div>
</div>
</div>
</div>
<xpath expr="//form" position="inside">
<app data-string="ONLYOFFICE" string="ONLYOFFICE" name="onlyoffice_odoo" groups="base.group_system">
<block title="General Settings" name="onlyoffice_odoo">
<setting string="Document Server Url">
<field name="doc_server_public_url"/>
</setting>
</block>
<block title="Security" name="onlyoffice_odoo">
<setting string="Document Server JWT Secret">
<field name="doc_server_jwt_secret"/>
</setting>
<setting string="Document Server JWT Header">
<field name="doc_server_jwt_header"/>
</setting>
</block>
</app>
</xpath>
</field>
</record>
Expand Down
2 changes: 1 addition & 1 deletion onlyoffice_odoo/views/templates.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>

<!-- -->
<!-- (c) Copyright Ascensio System SIA 2023 -->
<!-- (c) Copyright Ascensio System SIA 2024 -->
<!-- -->

<odoo>
Expand Down
Loading

0 comments on commit 9f8d33a

Please sign in to comment.