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
=== 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:12:43 +0000
@@ -765,7 +765,12 @@
765 """765 """
766 if not action.get('views'):766 if not action.get('views'):
767 generate_views(action)767 generate_views(action)
768768 else:
769 action_views = {}
770 view_modes = action['view_mode'].split(',')
771 for view in action['views']:
772 action_views[view[1]] = view
773 action['views'] = [action_views[x] for x in view_modes]
769 id_form = None774 id_form = None
770 for index, (id, mode) in enumerate(action['views']):775 for index, (id, mode) in enumerate(action['views']):
771 if mode == 'form':776 if mode == 'form':