Mohammed Shekha(Open ERP) has proposed merging 
lp:~openerp-dev/openerp-web/6.1-opw-578854-msh into lp:openerp-web/6.1.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/6.1-opw-578854-msh/+merge/123049

Hello,

Fixed the issue of view mode doesn't given priority then views, when there is 
views defined then web-client will load the view in the sequence of views, the 
behaviour should that view mode must given highest priority like if view mode 
is "graph,tree" and views are "[(id, tree), (id, graph)]" then web client is 
loading tree first, the views is specifically used for loading specific view, 
if there is views available then also it should load the view according to view 
mode.

Demo :- To reproduce the issue(For Purchase Dashboard),
1) From menu `Setting/Customization/Actions/Windows Action`, search for 
`Monthly Purchase by Category` and remove the View Ref`(view_id).
Open Purchase order dashboard, it will open the "Monthly Purchase by Category" 
tree view instead of graph view.

Thanks.
-- 
https://code.launchpad.net/~openerp-dev/openerp-web/6.1-opw-578854-msh/+merge/123049
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openerp-web/6.1-opw-578854-msh.
=== modified file 'addons/web/controllers/main.py'
--- addons/web/controllers/main.py	2012-08-31 11:34:18 +0000
+++ addons/web/controllers/main.py	2012-09-06 11:00:46 +0000
@@ -765,7 +765,12 @@
     """
     if not action.get('views'):
         generate_views(action)
-
+    else:
+        action_views = {}
+        view_modes = action['view_mode'].split(',')
+        for x in action['views']:
+            action_views[x[1]] = x
+        action['views'] = [action_views[x] for x in view_modes]
     id_form = None
     for index, (id, mode) in enumerate(action['views']):
         if mode == 'form':

_______________________________________________
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