Xavier (Open ERP) has proposed merging 
lp:~openerp-dev/openobject-client-web/6.0-bug-16165-msh into 
lp:openobject-client-web/6.0 with 
lp:~openerp-dev/openobject-client-web/6.0-bug-6179-msh as a prerequisite.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #810746 in OpenERP Web Client: "[6.0] Opening of new window causes call 
to model with wrong IDs !"
  https://bugs.launchpad.net/openobject-client-web/+bug/810746

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-bug-16165-msh/+merge/69269

Hello,

Change the code so that when record opened in new tab at that time menu remains 
persistent, before that when record was opened in new tab menu were changed and 
by default sale menu came. This was handled by revision no. 4642 but due to 
this revision issue 16165 was arise i.e. parent_id not found that is because we 
are setting id of data in active_id of context so according to revision 4642 
the code will make rpc call with active_id of context for fetching menu id 
which is actually id of data.


Thanx.
-- 
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-bug-16165-msh/+merge/69269
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-client-web/6.0-bug-6179-msh.
=== modified file 'addons/openerp/controllers/actions.py'
--- addons/openerp/controllers/actions.py	2011-05-23 13:07:54 +0000
+++ addons/openerp/controllers/actions.py	2011-07-26 12:43:45 +0000
@@ -198,7 +198,7 @@
     if not action.get('opened'):
         action.setdefault('target', 'current')
         return act_window_opener(action, data)
-
+    
     for key in ('res_id', 'res_model', 'view_type',
                 'view_mode', 'limit', 'search_view'):
         data[key] = action.get(key, data.get(key))
@@ -226,7 +226,13 @@
         view_ids = [action['view_id'][0]]
     if not action.get('domain'):
         action['domain'] = '[]'
-
+    
+    global menu_id
+    menu_id = False
+    
+    if not data['context'].get('active_id'):
+        menu_id = data.get('id', False)
+    
     ctx = dict(data.get('context', {}),
         active_id=data.get('id', False),
         active_ids=data.get('ids', []),
@@ -367,8 +373,8 @@
 
     if open_new_tab:
         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]
+        if menu_id:
+            parent = rpc.RPCProxy('ir.ui.menu').read([int(menu_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})

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to