Use get method in Binary widget when field has not get_data method
The binary widget can be used with non-binary field which does not have get_data method like Char. issue5989 review29701002
This commit is contained in:
+7
-1
@@ -2936,7 +2936,13 @@
|
||||
var mimetype = params.mimetype || 'application/octet-binary';
|
||||
var field = this.field();
|
||||
var record = this.record();
|
||||
field.get_data(record).done(function(data) {
|
||||
var prm;
|
||||
if (field.get_data) {
|
||||
prm = field.get_data(record);
|
||||
} else {
|
||||
prm = jQuery.when(field.get(record));
|
||||
}
|
||||
prm.done(function(data) {
|
||||
var blob = new Blob([data], {type: mimetype});
|
||||
var blob_url = window.URL.createObjectURL(blob);
|
||||
if (this.blob_url) {
|
||||
|
||||
Reference in New Issue
Block a user