-
4muk_web_preview_attachment/README.md
-
2muk_web_preview_attachment/__init__.py
-
13muk_web_preview_attachment/__manifest__.py
-
6muk_web_preview_attachment/doc/changelog.rst
-
48muk_web_preview_attachment/doc/index.rst
-
2muk_web_preview_attachment/models/__init__.py
-
5muk_web_preview_attachment/models/ir_attachment.py
-
BINmuk_web_preview_attachment/static/description/demo.gif
-
36muk_web_preview_attachment/static/description/index.html
-
BINmuk_web_preview_attachment/static/description/screenshot_chatter.png
-
BINmuk_web_preview_attachment/static/description/screenshot_sidebar.png
-
48muk_web_preview_attachment/static/src/js/widget_preview.js
-
6muk_web_preview_attachment/static/src/less/sidebar_preview.less
-
33muk_web_preview_attachment/static/src/less/widget_preview.less
-
35muk_web_preview_attachment/static/src/xml/widget_preview.xml
-
2muk_web_preview_attachment/template/assets.xml
-
3muk_web_preview_attachment/tests/__init__.py
-
18muk_web_preview_attachment/tests/test_attachment_extension.py
@ -1,4 +0,0 @@ |
|||||
# MuK Preview Attachment |
|
||||
|
|
||||
Adds a button to the Attachment Sidebar to preview the content directly in the browser. |
|
||||
The module also enables the possibility to preview attachment in the Odoo Chat Widgets. |
|
@ -1,3 +1,9 @@ |
|||||
|
`2.0.0` |
||||
|
------- |
||||
|
|
||||
|
- Migrated to Python 3 |
||||
|
- Support for FieldMany2ManyBinaryMultiFiles Widget |
||||
|
|
||||
`1.0.0` |
`1.0.0` |
||||
------- |
------- |
||||
|
|
||||
|
@ -0,0 +1,48 @@ |
|||||
|
====================== |
||||
|
MuK Preview Attachment |
||||
|
====================== |
||||
|
|
||||
|
Adds a button to the Attachment Sidebar to preview the content directly in the |
||||
|
browser. The module also enables the possibility to preview attachment in the |
||||
|
Odoo Chat Widgets. |
||||
|
|
||||
|
Installation |
||||
|
============ |
||||
|
|
||||
|
To install this module, you need to: |
||||
|
|
||||
|
Download the module and add it to your Odoo addons folder. Afterward, log on to |
||||
|
your Odoo server and go to the Apps menu. Trigger the debug modus and update the |
||||
|
list by clicking on the "Update Apps List" link. Now install the module by |
||||
|
clicking on the install button. |
||||
|
|
||||
|
Configuration |
||||
|
============= |
||||
|
|
||||
|
No additional configuration is needed to use this module. |
||||
|
|
||||
|
Usage |
||||
|
============= |
||||
|
|
||||
|
Attachment views as well as attachments in the chatter widgets can be previewed |
||||
|
using the Preview dialog. |
||||
|
|
||||
|
Credits |
||||
|
======= |
||||
|
|
||||
|
Contributors |
||||
|
------------ |
||||
|
|
||||
|
* Mathias Markl <mathias.markl@mukit.at> |
||||
|
|
||||
|
Author & Maintainer |
||||
|
------------------- |
||||
|
|
||||
|
This module is maintained by the `MuK IT GmbH <https://www.mukit.at/>`_. |
||||
|
|
||||
|
MuK IT is an Austrian company specialized in customizing and extending Odoo. |
||||
|
We develop custom solutions for your individual needs to help you focus on |
||||
|
your strength and expertise to grow your business. |
||||
|
|
||||
|
If you want to get in touch please contact us via mail |
||||
|
(sale@mukit.at) or visit our website (https://mukit.at). |
Before Width: 1422 | Height: 703 | Size: 842 KiB After Width: 1200 | Height: 675 | Size: 632 KiB |
Before Width: 1920 | Height: 948 | Size: 46 KiB After Width: 1425 | Height: 802 | Size: 98 KiB |
Before Width: 1920 | Height: 949 | Size: 89 KiB After Width: 1425 | Height: 802 | Size: 150 KiB |
@ -0,0 +1,48 @@ |
|||||
|
/********************************************************************************** |
||||
|
* |
||||
|
* Copyright (C) 2017 MuK IT GmbH |
||||
|
* |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU Affero General Public License as |
||||
|
* published by the Free Software Foundation, either version 3 of the |
||||
|
* License, or (at your option) any later version. |
||||
|
* |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU Affero General Public License for more details. |
||||
|
* |
||||
|
* You should have received a copy of the GNU Affero General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
* |
||||
|
**********************************************************************************/ |
||||
|
|
||||
|
odoo.define('muk_preview_attachment.WidgetPreview', function (require) { |
||||
|
"use strict"; |
||||
|
|
||||
|
var core = require('web.core'); |
||||
|
var session = require('web.session'); |
||||
|
var fields = require('web.relational_fields'); |
||||
|
|
||||
|
var PreviewHelper = require('muk_preview_attachment.PreviewHelper'); |
||||
|
|
||||
|
var QWeb = core.qweb; |
||||
|
var _t = core._t; |
||||
|
|
||||
|
fields.FieldMany2ManyBinaryMultiFiles.include({ |
||||
|
init: function() { |
||||
|
this._super.apply(this, arguments); |
||||
|
this.events = _.extend(this.events, { |
||||
|
'click .oe_attachment .o_image': '_preview', |
||||
|
'click .o_attachment_preview': '_preview', |
||||
|
}); |
||||
|
}, |
||||
|
_preview: function(e) { |
||||
|
e.preventDefault(); |
||||
|
e.stopPropagation(); |
||||
|
PreviewHelper.createAttachmentPreview( |
||||
|
$(e.currentTarget).data('id'), this); |
||||
|
}, |
||||
|
}); |
||||
|
|
||||
|
}); |
@ -0,0 +1,33 @@ |
|||||
|
/********************************************************************************** |
||||
|
* |
||||
|
* Copyright (C) 2017 MuK IT GmbH |
||||
|
* |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU Affero General Public License as |
||||
|
* published by the Free Software Foundation, either version 3 of the |
||||
|
* License, or (at your option) any later version. |
||||
|
* |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU Affero General Public License for more details. |
||||
|
* |
||||
|
* You should have received a copy of the GNU Affero General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||
|
* |
||||
|
**********************************************************************************/ |
||||
|
|
||||
|
.o_attachment_preview { |
||||
|
border: 0; |
||||
|
cursor: pointer; |
||||
|
padding: 0; |
||||
|
background: transparent; |
||||
|
-webkit-appearance: none; |
||||
|
opacity: 0.9; |
||||
|
filter: alpha(opacity=90); |
||||
|
|
||||
|
&:hover , &:focus { |
||||
|
opacity: 1; |
||||
|
filter: alpha(opacity=100); |
||||
|
} |
||||
|
} |
@ -0,0 +1,35 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
|
||||
|
<!-- |
||||
|
Copyright (C) 2017 MuK IT GmbH |
||||
|
|
||||
|
This program is free software: you can redistribute it and/or modify |
||||
|
it under the terms of the GNU Affero General Public License as |
||||
|
published by the Free Software Foundation, either version 3 of the |
||||
|
License, or (at your option) any later version. |
||||
|
|
||||
|
This program is distributed in the hope that it will be useful, |
||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
GNU Affero General Public License for more details. |
||||
|
|
||||
|
You should have received a copy of the GNU Affero General Public License |
||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||
|
--> |
||||
|
|
||||
|
<templates> |
||||
|
<t t-extend="FieldBinaryFileUploader.files"> |
||||
|
<t t-jquery="a[target='_blank']" t-operation="before"> |
||||
|
<t t-if="widget.mode === 'readonly'"> |
||||
|
<button type="button" class="o_attachment_preview" aria-hidden="true" t-att-data-id="file.data.id"> |
||||
|
<i class="fa fa-file-text-o" t-att-data-id="file.data.id"></i> |
||||
|
</button> |
||||
|
</t> |
||||
|
</t> |
||||
|
<t t-jquery=".o_image" t-operation="attributes"> |
||||
|
<attribute name="t-att-data-id">widget.metadata[file.id] ? file.data.id : false</attribute> |
||||
|
</t> |
||||
|
</t> |
||||
|
</templates> |
||||
|
|
||||
|
|