Farid Ghanchi (OpenERP) has proposed merging 
lp:~openerp-dev/openerp-web/trunk-opw-578854-port-ggh into lp:openerp-web.

Requested reviews:
  OpenERP R&D Web Team (openerp-dev-web)

For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-opw-578854-port-ggh/+merge/138909

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, but actully load 'graph'. 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/Technical/Actions/Windows Action`, 
2) search for `Monthly Purchase by Category` default view_mode = 'graph,tree' 
is correct and remove the View Ref`(view_id).
3) see bottom side view in 'Add an Item' add the 'view type' (suppose 
tree,graph) differ from view_mode. and save.
 
4) Open Purchase order dashboard, Reporting> Purchase it will open the "Monthly 
Purchase by Category" tree view instead of graph view.

Thanks.
-- 
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-opw-578854-port-ggh/+merge/138909
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openerp-web/trunk-opw-578854-port-ggh.
=== modified file 'addons/web/controllers/main.py'
--- addons/web/controllers/main.py	2012-12-04 16:39:48 +0000
+++ addons/web/controllers/main.py	2012-12-10 07:02:24 +0000
@@ -433,6 +433,12 @@
     """
     if not action.get('views'):
         generate_views(action)
+    else:
+        action_views = {}
+        view_modes = action['view_mode'].split(',')
+        for view in action['views']:
+            action_views[view[1]] = view
+        action['views'] = [action_views[x] for x in view_modes]
 
     if action.pop('view_type', 'form') != 'form':
         return action

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : openerp-dev-gtk@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to