diff options
| author | Xavier Morel <xmo@openerp.com> | 2011-10-17 16:58:49 +0200 |
|---|---|---|
| committer | Xavier Morel <xmo@openerp.com> | 2011-10-17 16:58:49 +0200 |
| commit | 548a809ff5853f3c97d6cd6bc3c71fa850d58289 (patch) | |
| tree | b5cb660fd51d63278b67da5b0b9c8d07165cd33b /addons/web/static/src | |
| parent | 5823bf1634923d2f19144fc70d37ffeac8a7195b (diff) | |
[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
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/view_form.js | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index e998b3b2afc..06171ed1d73 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -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) { |
