[MERGE] forward port branch 11.0 up to f96a797fe6
This commit is contained in:
@@ -1233,7 +1233,7 @@ var FieldBinaryFile = AbstractFieldBinary.extend({
|
||||
template: 'FieldBinaryFile',
|
||||
events: _.extend({}, AbstractFieldBinary.prototype.events, {
|
||||
'click': function (event) {
|
||||
if (this.mode === 'readonly' && this.value) {
|
||||
if (this.mode === 'readonly' && this.value && this.recordData.id) {
|
||||
this.on_save_as(event);
|
||||
}
|
||||
},
|
||||
@@ -1250,10 +1250,20 @@ var FieldBinaryFile = AbstractFieldBinary.extend({
|
||||
this.do_toggle(!!this.value);
|
||||
if (this.value) {
|
||||
this.$el.empty().append($("<span/>").addClass('fa fa-download'));
|
||||
if (this.recordData.id) {
|
||||
this.$el.css('cursor', 'pointer');
|
||||
} else {
|
||||
this.$el.css('cursor', 'not-allowed');
|
||||
}
|
||||
if (this.filename_value) {
|
||||
this.$el.append(" " + this.filename_value);
|
||||
}
|
||||
}
|
||||
if (!this.res_id) {
|
||||
this.$el.css('cursor', 'not-allowed');
|
||||
} else {
|
||||
this.$el.css('cursor', 'pointer');
|
||||
}
|
||||
},
|
||||
_renderEdit: function () {
|
||||
if (this.value) {
|
||||
@@ -1278,7 +1288,7 @@ var FieldBinaryFile = AbstractFieldBinary.extend({
|
||||
if (!this.value) {
|
||||
this.do_warn(_t("Save As..."), _t("The field is empty, there's nothing to save !"));
|
||||
ev.stopPropagation();
|
||||
} else {
|
||||
} else if (this.res_id) {
|
||||
framework.blockUI();
|
||||
var c = crash_manager;
|
||||
var filename_fieldname = this.attrs.filename;
|
||||
|
||||
Reference in New Issue
Block a user