[MERGE] forward port branch 11.0 up to 3b80a059ff

This commit is contained in:
Christophe Simonis
2018-01-12 19:03:00 +01:00
62 changed files with 463 additions and 180 deletions
@@ -1094,6 +1094,7 @@ var AbstractFieldBinary = AbstractField.extend({
},
'click .o_clear_file_button': 'on_clear',
}),
context: { bin_size: true },
init: function (parent, name, record) {
this._super.apply(this, arguments);
this.fields = record.fields;
@@ -1312,25 +1313,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
@@ -2561,7 +2543,6 @@ return {
TranslatableFieldMixin: TranslatableFieldMixin,
DebouncedField: DebouncedField,
FieldEmail: FieldEmail,
FieldBinaryDownloadLink: FieldBinaryDownloadLink,
FieldBinaryFile: FieldBinaryFile,
FieldBinaryImage: FieldBinaryImage,
FieldBoolean: FieldBoolean,