summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/fields/basic_fields.js
diff options
context:
space:
mode:
authorAlexandre Kühn <alex.e.kuhn@gmail.com>2018-01-08 22:08:21 +0100
committerAlexandre Kühn <alexkuhn@users.noreply.github.com>2018-01-12 16:12:49 +0100
commit7813a8e714f268983b0be88827ae1c8ad887e6c7 (patch)
tree928daa6f9d6f84420d8dee7afdabf99c41d232b7 /addons/web/static/src/js/fields/basic_fields.js
parentc3e3770f06db6b427118a3a2c5629d3aa9efaaa8 (diff)
[FIX] web: binaryfile field in list views
Revert partially 255e8ca3d92e3a77d7c2a145677623518bc2f978 Removed widget 'download_link', as it was a sub-version of widget 'binary': it did the exact same thing (representation of binary fields by means of a download link) in a much better-looking way (download icon + filename as text of the download link, instead of just a download link with text "Download"). Also, the values of binary fields might be already a human-readable binsize (e.g. 2.52 MBs), instead of its plain textual string representation in base64: The contextual parameter 'bin_size', when set to true, does not download the data of binary fields. As a consequence, the server provides the sizes of the binary, instead of their value.
Diffstat (limited to 'addons/web/static/src/js/fields/basic_fields.js')
-rw-r--r--addons/web/static/src/js/fields/basic_fields.js20
1 files changed, 0 insertions, 20 deletions
diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js
index 38fc0cad439..09406b43711 100644
--- a/addons/web/static/src/js/fields/basic_fields.js
+++ b/addons/web/static/src/js/fields/basic_fields.js
@@ -1298,25 +1298,6 @@ var FieldBinaryFile = AbstractFieldBinary.extend({
},
});
-var FieldBinaryDownloadLink = AbstractFieldBinary.extend({
- template: 'FieldBinaryDownloadLink',
- events: _.extend({}, AbstractFieldBinary.prototype.events, {
- 'click': function (ev) {
- ev.stopPropagation();
- },
- }),
- supportedFieldTypes: ['binary'],
- init: function () {
- this._super.apply(this, arguments);
- this.filename = _t("Binary File");
- if (this.nodeOptions.filename && this.recordData[this.nodeOptions.filename]) {
- this.filename = this.recordData[this.nodeOptions.filename];
- }
- this.url = "data:application/octet-stream;base64," + this.value;
- this.text = _t("Download");
- },
-});
-
var PriorityWidget = AbstractField.extend({
// the current implementation of this widget makes it
// only usable for fields of type selection
@@ -2547,7 +2528,6 @@ return {
TranslatableFieldMixin: TranslatableFieldMixin,
DebouncedField: DebouncedField,
FieldEmail: FieldEmail,
- FieldBinaryDownloadLink: FieldBinaryDownloadLink,
FieldBinaryFile: FieldBinaryFile,
FieldBinaryImage: FieldBinaryImage,
FieldBoolean: FieldBoolean,