Merge lp:~openerp-dev/openobject-client-web/ir_action_act_url into lp:openobject-client-web/trunk

Proposed by Vaibhav Darji
Status: Rejected
Rejected by: Xavier (Open ERP)
Proposed branch: lp:~openerp-dev/openobject-client-web/ir_action_act_url
Merge into: lp:openobject-client-web/trunk
Diff against target: 59 lines (+21/-3)
3 files modified
addons/openerp/controllers/actions.py (+7/-2)
addons/openerp/controllers/templates/report.mako (+1/-0)
addons/openerp/static/javascript/openerp/openerp.base.js (+13/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-client-web/ir_action_act_url
Reviewer Review Type Date Requested Status
Xavier (Open ERP) (community) Disapprove
Review via email: mp+41837@code.launchpad.net

Description of the change

when perform actions like `ir.actions.act_url` or `reports` it clear the base source from where these actions are called.

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

Bug not fixed.

Create an act_url linking to "/" with target new, set that on a menuitem, click on the menuitem, it opens the site's root within the content frame instead of opening it in a new window which is not the expected behavior.

Furthermore, the way you're handling it seems very not straightforward at all.

review: Disapprove

Unmerged revisions

3955. By Vaibhav Darji

[FIX] AppContent data remains when reports or ir.action.act_url(we do not have returned controller).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/openerp/controllers/actions.py'
2--- addons/openerp/controllers/actions.py 2010-11-23 11:50:14 +0000
3+++ addons/openerp/controllers/actions.py 2010-11-25 09:37:53 +0000
4@@ -362,10 +362,15 @@
5 return """<html>
6 <head>
7 <script language="javascript" type="text/javascript">
8- window.open('%s')
9+ window.open('%s')
10 </script>
11 </head>
12- <body></body>
13+ <body>
14+ <div>
15+ <input type="hidden" id="is_act_url" value="true">
16+ </div>
17+
18+ </body>
19 </html>
20 """ % (tools.redirect(url)[0][0])
21 else:
22
23=== modified file 'addons/openerp/controllers/templates/report.mako'
24--- addons/openerp/controllers/templates/report.mako 2010-09-23 05:32:25 +0000
25+++ addons/openerp/controllers/templates/report.mako 2010-11-25 09:37:53 +0000
26@@ -4,6 +4,7 @@
27 </head>
28 <body>
29 <form id="report" action="/openerp/report" method="POST" target="_blank">
30+ <input type="hidden" id="is_act_url" value="true">
31 <input type="hidden" name="report_name" value="${name}">
32 % for key, value in data.iteritems():
33 <input type="hidden" name="${key}" value="${value}">
34
35=== modified file 'addons/openerp/static/javascript/openerp/openerp.base.js'
36--- addons/openerp/static/javascript/openerp/openerp.base.js 2010-11-25 06:24:05 +0000
37+++ addons/openerp/static/javascript/openerp/openerp.base.js 2010-11-25 09:37:53 +0000
38@@ -77,8 +77,20 @@
39 window.top.openAction(action_url, target);
40 return;
41 }
42+
43 jQuery(window).trigger('before-appcontent-change');
44- jQuery(app).html(xhr.responseText || data);
45+ if (jQuery(xhr.responseText || data).find('input#is_act_url').length) {
46+ if (!jQuery(app).find('input#is_act_url').length) {
47+ jQuery(app).append(jQuery('<div>', {'id': 'action_url'}))
48+ jQuery('#action_url').html(xhr.responseText || data)
49+ }
50+ else {
51+ jQuery(app).find('#action_url').html(xhr.responseText || data)
52+ }
53+ }
54+ else {
55+ jQuery(app).html(xhr.responseText || data);
56+ }
57 jQuery(window).trigger('after-appcontent-change');
58 }
59 }