← Back to team overview

openerp-dev-web team mailing list archive

[Merge] lp:~openerp-dev/openobject-client-web/6.0-opw-5857-sma into lp:openobject-client-web/6.0

 

Sananaz (Open ERP) has proposed merging lp:~openerp-dev/openobject-client-web/6.0-opw-5857-sma into lp:openobject-client-web/6.0.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-opw-5857-sma/+merge/61970

Hello,

when select the Menu Accounting->Charts->Charts of Accounts, the chart 
of account is displayed which is correct
but it is displayed in the Sales Frame
So the Menu has switched from Accounting to Sales.

So the problem is, forms got displayed correctly but the menu on the left 
always shows the Sales Frame.

Thanks.

-- 
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-opw-5857-sma/+merge/61970
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-client-web/6.0-opw-5857-sma.
=== modified file 'addons/openerp/controllers/actions.py'
--- addons/openerp/controllers/actions.py	2011-05-10 07:16:46 +0000
+++ addons/openerp/controllers/actions.py	2011-05-23 13:14:40 +0000
@@ -366,7 +366,14 @@
            urllib.urlencode({'payload': compressed_payload}))
 
     if open_new_tab:
-        url = '/?' + urllib.urlencode({'next': url})
+        parent_id = False
+        if data['context'] and data['context'].get('active_id') and not data.get('model'):
+            parent = rpc.RPCProxy('ir.ui.menu').read([int(data['context']['active_id'])],['complete_name'], rpc.session.context)[0]['complete_name'].split('/')[0]
+            parent_id = rpc.RPCProxy('ir.ui.menu').search([('name','=', parent),('parent_id','=',False)],0,0,0, rpc.session.context)
+        if parent_id:
+            url = '/openerp/?' + urllib.urlencode({'active': parent_id[0],'next': url})
+        else:
+            url = '/openerp/?' + urllib.urlencode({'next': url})
 
     cherrypy.response.headers['X-Target'] = action['target']
     cherrypy.response.headers['Location'] = url

=== modified file 'addons/openerp/controllers/root.py'
--- addons/openerp/controllers/root.py	2011-03-16 09:42:09 +0000
+++ addons/openerp/controllers/root.py	2011-05-23 13:14:40 +0000
@@ -50,9 +50,11 @@
             user_action_id = rpc.RPCProxy("res.users").read([rpc.session.uid], ['action_id'], rpc.session.context)[0]['action_id']
             if user_action_id:
                 next = '/openerp/home'
-        
+        if active:
+            return self.menu(active, next)
+
         return self.menu(next=next)
-    
+
     @expose()
     def home(self):
         context = rpc.session.context