summaryrefslogtreecommitdiff
path: root/addons/web
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2015-05-21 14:50:39 +0200
committerChristophe Simonis <chs@odoo.com>2015-05-21 14:50:39 +0200
commit14a7d52307fe30443e8f08a262d46f6d2f804bc1 (patch)
treeb8183ae7549206f27bac51d9f2eaaa5ce3e4a818 /addons/web
parent5cff8fbb7c70a372cb5116c2fb98fd622c4d4358 (diff)
parent327e471c9b5d30317b69396b0f0932ff445e3694 (diff)
[MERGE] forward port of branch 8.0 up to 327e471
Diffstat (limited to 'addons/web')
-rw-r--r--addons/web/controllers/main.py1
-rw-r--r--addons/web/static/src/js/views.js2
-rw-r--r--addons/web/static/src/xml/base.xml4
3 files changed, 4 insertions, 3 deletions
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py
index 43efd2c38d7..5aaf63d034f 100644
--- a/addons/web/controllers/main.py
+++ b/addons/web/controllers/main.py
@@ -1183,6 +1183,7 @@ class Binary(http.Controller):
}
except Exception:
args = {'error': "Something horrible happened"}
+ _logger.exception("Fail to upload attachment %s" % ufile.filename)
return out % (simplejson.dumps(callback), simplejson.dumps(args))
@http.route([
diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js
index d0f77b77593..73cb4e1161c 100644
--- a/addons/web/static/src/js/views.js
+++ b/addons/web/static/src/js/views.js
@@ -1023,7 +1023,7 @@ instance.web.Sidebar = instance.web.Widget.extend({
init: function(parent) {
var self = this;
this._super(parent);
- var view = this.getParent();
+ this.view = this.getParent();
this.sections = [
{ 'name' : 'print', 'label' : _t('Print'), },
{ 'name' : 'other', 'label' : _t('More'), }
diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml
index 379b28597ef..39173add5c6 100644
--- a/addons/web/static/src/xml/base.xml
+++ b/addons/web/static/src/xml/base.xml
@@ -625,12 +625,12 @@
</t>
<a class="oe_file_attachment" t-att-title="item.title or ''" t-att-data-section="section.name" t-att-data-index="item_index" t-att-href="item.url">
<t t-raw="item.label"/>
- <span t-if="section.name == 'files' and !item.callback" class="oe_sidebar_delete_item" t-att-data-id="item.id" title="Delete this attachment">
+ <span t-if="widget.view.is_action_enabled('edit') &amp;&amp; section.name == 'files' and !item.callback" class="oe_sidebar_delete_item" t-att-data-id="item.id" title="Delete this attachment">
<i class="fa fa-trash-o"/>
</span>
</a>
</li>
- <li t-if="section.name == 'files'" class="oe_sidebar_add_attachment">
+ <li t-if="widget.view.is_action_enabled('edit') &amp;&amp; section.name == 'files'" class="oe_sidebar_add_attachment">
<t t-call="HiddenInputFile">
<t t-set="fileupload_id" t-value="widget.fileupload_id"/>
<t t-set="fileupload_action" t-translation="off">/web/binary/upload_attachment</t>