From 2236b72d099db9ad1fc63c89517e3a86b09e4f50 Mon Sep 17 00:00:00 2001 From: MuK IT GmbH Date: Sat, 13 Jul 2019 19:51:51 +0000 Subject: [PATCH] publish muk_web_export - 11.0 --- muk_web_export/__manifest__.py | 2 +- muk_web_export/static/src/js/export_widgets.js | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/muk_web_export/__manifest__.py b/muk_web_export/__manifest__.py index c65c295..57af44c 100644 --- a/muk_web_export/__manifest__.py +++ b/muk_web_export/__manifest__.py @@ -20,7 +20,7 @@ { "name": "MuK Export", "summary": """File Export Dialog""", - "version": "11.0.1.0.5", + "version": "11.0.1.0.7", "category": "Extra Tools", "license": "AGPL-3", "website": "http://www.mukit.at", diff --git a/muk_web_export/static/src/js/export_widgets.js b/muk_web_export/static/src/js/export_widgets.js index 758b265..fa5a0e8 100644 --- a/muk_web_export/static/src/js/export_widgets.js +++ b/muk_web_export/static/src/js/export_widgets.js @@ -62,10 +62,10 @@ fields.FieldBinaryFile.include({ $button.click(function(e) { e.preventDefault(); e.stopPropagation(); - var value = self.get('value'); + var value = self.value; var filename_fieldname = self.attrs.filename; var filename = self.recordData[filename_fieldname] || null; - var url = '/web/content?' + $.param({ + var url = '/web/content?' + $.param({ 'model': self.model, 'id': self.res_id, 'field': self.name, @@ -74,6 +74,7 @@ fields.FieldBinaryFile.include({ 'download': true, 'data': utils.is_bin_size(value) ? null : value, }); + self.do_action({ 'type': 'ir.actions.act_window', 'res_model': "muk_converter.convert", @@ -83,8 +84,8 @@ fields.FieldBinaryFile.include({ 'view_mode': 'form', 'target': 'new', 'context': { - 'default_type': "url", - 'default_input_url': url, + 'default_input_url': utils.is_bin_size(value) ? url : null, + 'default_input_binary': utils.is_bin_size(value) ? null : value, 'default_input_name': filename, }, });