[MERGE] forward port branch 11.0 up to ff0abd214c

This commit is contained in:
Christophe Simonis
2018-01-10 11:41:35 +01:00
83 changed files with 2789 additions and 1787 deletions
@@ -582,6 +582,7 @@ var FieldMonetary = InputField.extend({
this.formatOptions.currency = this.currency;
this.formatOptions.digits = [16, 2];
this.formatOptions.field_digits = this.nodeOptions.field_digits;
},
//--------------------------------------------------------------------------
@@ -1311,6 +1312,25 @@ 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
@@ -2541,6 +2561,7 @@ return {
TranslatableFieldMixin: TranslatableFieldMixin,
DebouncedField: DebouncedField,
FieldEmail: FieldEmail,
FieldBinaryDownloadLink: FieldBinaryDownloadLink,
FieldBinaryFile: FieldBinaryFile,
FieldBinaryImage: FieldBinaryImage,
FieldBoolean: FieldBoolean,