← Back to team overview

openerp-dev-web team mailing list archive

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

 

vda(Open ERP) has proposed merging lp:~openerp-dev/openobject-client-web/ir_action_act_url into lp:openobject-client-web.

Requested reviews:
  OpenERP SA's Web Client R&D (openerp-dev-web)
Related bugs:
  #680672 [TRUNK][rev 3932]ir.actions.act_url ignore target
  https://bugs.launchpad.net/bugs/680672


when perform actions like `ir.actions.act_url` or `reports` it clear the base source from where these actions are called.
-- 
https://code.launchpad.net/~openerp-dev/openobject-client-web/ir_action_act_url/+merge/41837
Your team OpenERP SA's Web Client R&D is requested to review the proposed merge of lp:~openerp-dev/openobject-client-web/ir_action_act_url into lp:openobject-client-web.
=== modified file 'addons/openerp/controllers/actions.py'
--- addons/openerp/controllers/actions.py	2010-11-23 11:50:14 +0000
+++ addons/openerp/controllers/actions.py	2010-11-25 09:37:53 +0000
@@ -362,10 +362,15 @@
         return """<html>
                 <head>
                     <script language="javascript" type="text/javascript">
-                        window.open('%s')
+                            window.open('%s')
                     </script>
                 </head>
-                <body></body>
+                <body>
+                    <div>
+                        <input type="hidden" id="is_act_url" value="true">
+                    </div>
+                    
+                </body>
                 </html>
                 """ % (tools.redirect(url)[0][0])
     else:

=== modified file 'addons/openerp/controllers/templates/report.mako'
--- addons/openerp/controllers/templates/report.mako	2010-09-23 05:32:25 +0000
+++ addons/openerp/controllers/templates/report.mako	2010-11-25 09:37:53 +0000
@@ -4,6 +4,7 @@
     </head>
     <body>
         <form id="report" action="/openerp/report" method="POST" target="_blank">
+            <input type="hidden" id="is_act_url" value="true">
             <input type="hidden" name="report_name" value="${name}">
             % for key, value in data.iteritems():
                 <input type="hidden" name="${key}" value="${value}">

=== modified file 'addons/openerp/static/javascript/openerp/openerp.base.js'
--- addons/openerp/static/javascript/openerp/openerp.base.js	2010-11-25 06:24:05 +0000
+++ addons/openerp/static/javascript/openerp/openerp.base.js	2010-11-25 09:37:53 +0000
@@ -77,8 +77,20 @@
             window.top.openAction(action_url, target);
             return;
         }
+        
         jQuery(window).trigger('before-appcontent-change');
-        jQuery(app).html(xhr.responseText || data);
+        if (jQuery(xhr.responseText || data).find('input#is_act_url').length) {
+            if (!jQuery(app).find('input#is_act_url').length) {
+                jQuery(app).append(jQuery('<div>', {'id': 'action_url'}))
+                jQuery('#action_url').html(xhr.responseText || data)
+            }
+            else {
+                jQuery(app).find('#action_url').html(xhr.responseText || data)
+            }
+        }
+        else {
+            jQuery(app).html(xhr.responseText || data);
+        }
         jQuery(window).trigger('after-appcontent-change');
     }
 }


Follow ups