Merge lp:~openerp-dev/openerp-web/trunk-bug-1082616-ggh into lp:openerp-web

Proposed by Farid Ghanchi
Status: Rejected
Rejected by: Fabien Meghazi (OpenERP)
Proposed branch: lp:~openerp-dev/openerp-web/trunk-bug-1082616-ggh
Merge into: lp:openerp-web
Diff against target: 23 lines (+3/-3)
1 file modified
addons/web/static/src/js/view_form.js (+3/-3)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/trunk-bug-1082616-ggh
Reviewer Review Type Date Requested Status
Farid Ghanchi (community) Needs Resubmitting
Xavier (Open ERP) (community) Disapprove
Review via email: mp+136621@code.launchpad.net

Description of the change

Hello,

>>> Not get the filename so i have get the filename in view.datarecord

>>>step:
1. Install new module OpenERP Reprot Designer
2. During installation process, clicking to download openerp_report_designer.zip package.
3. Error display.....

Thanks...

To post a comment you must log in.
Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

1. where the hell does that link content change come from?
2. I'm not convinced this is the best place to go and fetch the current file's name…

review: Disapprove
3512. By Farid Ghanchi

[Fix] fixed the issue can't download openerp report designer

Revision history for this message
Farid Ghanchi (gfarid) wrote :

Hello

widget had set effective_readonly so set oe_form_uri class

In this issue widget is set effective readonly so no get the oe_form_binary_file_save_data
so check the condition and class will be find
I hope this code is usefull

Thanks....

review: Needs Resubmitting
Revision history for this message
Fabien Meghazi (OpenERP) (fme) wrote :

Fixed in trunk's Revision:
3589 revid:<email address hidden>

Unmerged revisions

3512. By Farid Ghanchi

[Fix] fixed the issue can't download openerp report designer

3511. By Farid Ghanchi

[Fix] Fixed the issue of Can't download openerp_report_designer.zip package

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/web/static/src/js/view_form.js'
2--- addons/web/static/src/js/view_form.js 2012-11-28 13:50:13 +0000
3+++ addons/web/static/src/js/view_form.js 2012-11-29 06:21:19 +0000
4@@ -4858,8 +4858,8 @@
5 this.do_warn(_t("Save As..."), _t("The field is empty, there's nothing to save !"));
6 ev.stopPropagation();
7 } else if (this._dirty_flag) {
8- var link = this.$('.oe_form_binary_file_save_data')[0];
9- link.download = this.filename || "download.bin"; // Works on only on Google Chrome
10+ var link = (this.get("effective_readonly")) ? this.$('.oe_form_uri')[0]:this.$('.oe_form_binary_file_save_data')[0];
11+ link.download = (this.filename ? this.filename : this.view.datarecord[this.node.attrs.filename]) || "download.bin"; // Works on only on Google Chrome
12 //link.target = '_blank';
13 link.href = "data:application/octet-stream;base64," + value;
14 } else {
15@@ -4908,7 +4908,7 @@
16 if (self.get('value')) {
17 self.on_save_as(ev);
18 }
19- return false;
20+ return true;
21 });
22 }
23 },