Merge lp:~openerp-dev/openerp-web/6.1-opw-578854-msh into lp:openerp-web/6.1

Proposed by Mohammed Shekha(Open ERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openerp-web/6.1-opw-578854-msh
Merge into: lp:openerp-web/6.1
Diff against target: 17 lines (+6/-1)
1 file modified
addons/web/controllers/main.py (+6/-1)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/6.1-opw-578854-msh
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+123049@code.launchpad.net

Description of the change

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.

To post a comment you must log in.
2451. By Mohammed Shekha(Open ERP)

[FIX]Refixed and just changed the variable with proper name.

Unmerged revisions

2451. By Mohammed Shekha(Open ERP)

[FIX]Refixed and just changed the variable with proper name.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/web/controllers/main.py'
2--- addons/web/controllers/main.py 2012-08-31 11:34:18 +0000
3+++ addons/web/controllers/main.py 2012-09-06 11:12:43 +0000
4@@ -765,7 +765,12 @@
5 """
6 if not action.get('views'):
7 generate_views(action)
8-
9+ else:
10+ action_views = {}
11+ view_modes = action['view_mode'].split(',')
12+ for view in action['views']:
13+ action_views[view[1]] = view
14+ action['views'] = [action_views[x] for x in view_modes]
15 id_form = None
16 for index, (id, mode) in enumerate(action['views']):
17 if mode == 'form':