summaryrefslogtreecommitdiff
path: root/addons/web_editor/controllers
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2017-12-12 13:06:14 +0100
committerqsm-odoo <qsm@odoo.com>2018-01-16 17:03:15 +0100
commitabde8bddf8ec45cf12aab59e95c330321158cfba (patch)
tree081b1b6432f48bf6a848173feafb91f62c37e3af /addons/web_editor/controllers
parent0dd41128ffa460bad4db78f28852e785dbbeab95 (diff)
[REF] web_editor, website(_*): refactore media & link dialogs
* blog, gengo, sale
Diffstat (limited to 'addons/web_editor/controllers')
-rw-r--r--addons/web_editor/controllers/main.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/addons/web_editor/controllers/main.py b/addons/web_editor/controllers/main.py
index 50a9540323a..3b123704973 100644
--- a/addons/web_editor/controllers/main.py
+++ b/addons/web_editor/controllers/main.py
@@ -140,7 +140,7 @@ class Web_Editor(http.Controller):
# add attachment (images or link)
#------------------------------------------------------
@http.route('/web_editor/attachment/add', type='http', auth='user', methods=['POST'])
- def attach(self, func, upload=None, url=None, disable_optimization=None, **kwargs):
+ def attach(self, upload=None, url=None, disable_optimization=None, **kwargs):
# the upload argument doesn't allow us to access the files if more than
# one file is uploaded, as upload references the first file
# therefore we have to recover the files from the request object
@@ -189,8 +189,9 @@ class Web_Editor(http.Controller):
message = pycompat.text_type(e)
return """<script type='text/javascript'>
- window.parent['%s'](%s, %s);
- </script>""" % (func, json.dumps(uploads), json.dumps(message))
+ window.attachments = %s;
+ window.error = %s;
+ </script>""" % (json.dumps(uploads), json.dumps(message))
#------------------------------------------------------
# remove attachment (images or link)