[FIX] downloading files from an unsaved/in-memory wizard
fallback on default_get if record does not exist in db, as for e.g. Thunderbird and Outlook plugins lp bug: https://launchpad.net/bugs/856487 fixed bzr revid: xmo@openerp.com-20111017145849-p8dq0eprkru4xtl1
This commit is contained in:
@@ -2642,14 +2642,10 @@ openerp.web.form.FieldBinary = openerp.web.form.Field.extend({
|
||||
on_file_uploaded_and_valid: function(size, name, content_type, file_base64) {
|
||||
},
|
||||
on_save_as: function() {
|
||||
if (!this.view.datarecord.id) {
|
||||
this.do_warn("Can't save file", "The record has not yet been saved");
|
||||
} else {
|
||||
var url = '/web/binary/saveas?session_id=' + this.session.session_id + '&model=' +
|
||||
this.view.dataset.model +'&id=' + (this.view.datarecord.id || '') + '&field=' + this.name +
|
||||
'&fieldname=' + (this.node.attrs.filename || '') + '&t=' + (new Date().getTime());
|
||||
window.open(url);
|
||||
}
|
||||
var url = '/web/binary/saveas?session_id=' + this.session.session_id + '&model=' +
|
||||
this.view.dataset.model +'&id=' + (this.view.datarecord.id || '') + '&field=' + this.name +
|
||||
'&fieldname=' + (this.node.attrs.filename || '') + '&t=' + (new Date().getTime());
|
||||
window.open(url);
|
||||
},
|
||||
on_clear: function() {
|
||||
if (this.value !== false) {
|
||||
|
||||
Reference in New Issue
Block a user