diff options
| author | Fabien Meghazi <fme@openerp.com> | 2012-02-08 11:39:35 +0100 |
|---|---|---|
| committer | Fabien Meghazi <fme@openerp.com> | 2012-02-08 11:39:35 +0100 |
| commit | 739b0d4861dff958d80c2c6fa5c86b1c3ed329a7 (patch) | |
| tree | 121ccd369a0683531153320d1eb6c243afe77e0c /addons/web/static/src/js | |
| parent | 5daa33329e9363210ffe0f6623177c8f6488f0ae (diff) | |
[FIX] Binary#save_as does not send context. Breaks some accounting downloadable reports.
Example of broken report was : Accounting > Reporting > Legal Reports > Belgium Statements > Periodical VAT Declaration
bzr revid: fme@openerp.com-20120208103935-cv9nn9kg1vssosgm
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/view_form.js | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index de9bc618048..ca1c2c29e6e 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -3122,10 +3122,19 @@ 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() { - var url = '/web/binary/saveas?session_id=' + this.session.session_id + '&model=' + - this.view.dataset.model +'&id=' + (this.view.datarecord.id || '') + '&field=' + this.name + - '&filename_field=' + (this.node.attrs.filename || '') + '&t=' + (new Date().getTime()); - window.open(url); + $.blockUI(); + this.session.get_file({ + url: '/web/binary/saveas_ajax', + data: {data: JSON.stringify({ + model: this.view.dataset.model, + id: (this.view.datarecord.id || ''), + field: this.name, + filename_field: (this.node.attrs.filename || ''), + context: this.view.dataset.get_context() + })}, + complete: $.unblockUI, + error: openerp.webclient.crashmanager.on_rpc_error + }); }, on_clear: function() { if (this.value !== false) { |
