Merge lp:~openerp-dev/openobject-client/6.1-opw-578157-rgo into lp:openobject-client/6.1

Proposed by Ravi Gohil (OpenERP)
Status: Merged
Approved by: Naresh(OpenERP)
Approved revision: 2089
Merged at revision: 2094
Proposed branch: lp:~openerp-dev/openobject-client/6.1-opw-578157-rgo
Merge into: lp:openobject-client/6.1
Diff against target: 27 lines (+5/-1)
2 files modified
bin/widget/screen/ (+1/-1)
bin/widget/view/form_gtk/ (+4/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-client/6.1-opw-578157-rgo
Reviewer Review Type Date Requested Status
Naresh(OpenERP) (community) Approve
Review via email:

Description of the change


When `view_id` not specified for `ir.actions.act_window`, the view with the lowest sequence number is shown for the respective model whereas the view should be taken from the `view_ids` specified in action of the first type specified in `view_mode`.

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),
2) go to `Setting/Customization/User Interface/Views` and search for graph views for object `` and set the sequence to `15` of view named `product.month.graph`,
3) Open Purchase Dashboard,

You will have `product.month.graph` view for `Monthly Purchase by Category` action instead of `purchase.order.monthly.categ.graph`(which is in `view_ids` of action).

This fix fixes this issue, kindly review the fix.

Note: Currently, web loads first view from `view_ids` irrespective of `view_mode`.


To post a comment you must log in.
2089. By Chris Biersbach (OpenERP)

[FIX] When switching views, only the first view was correctly loaded in the previous revision. This revision makes sure all the views are correctly loaded both when using the switch_view button and when left clicking on a line

Revision history for this message
Naresh(OpenERP) (nch-openerp) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/widget/screen/'
2--- bin/widget/screen/ 2011-10-11 06:15:57 +0000
3+++ bin/widget/screen/ 2012-10-02 09:21:29 +0000
4@@ -570,7 +570,7 @@
5 view_id = self.view_ids and self.view_ids.pop(idx) or False
6 else:
7 idx = 0
8- view_id = False
9+ view_id = self.view_ids and self.view_ids.pop(idx) or False
10 type = self.view_to_load.pop(idx)
11 self.add_view_id(view_id,type)
14=== modified file 'bin/widget/view/form_gtk/'
15--- bin/widget/view/form_gtk/ 2011-10-11 06:15:57 +0000
16+++ bin/widget/view/form_gtk/ 2012-10-02 09:21:29 +0000
17@@ -64,6 +64,10 @@
18 self.action_view_ids = map(lambda y:y[0], filter(lambda x:x[1] == 'tree',self.action['views']))
19 if self.action['view_type']=='form':
20 mode = (self.action['view_mode'] or 'form,tree').split(',')
21+ if not view_id:
22+ view_id = map(lambda y:y[0], filter(lambda x:x[1] == mode[0],self.action['views']))
23+ for extra_mode in mode[1:]:
24+ view_id.extend(map(lambda y:y[0], filter(lambda x:x[1] == extra_mode, self.action['views'])))
25 self.screen = Screen(self.action['res_model'], view_type=mode, context=self.context, view_ids = view_id, domain=self.domain)
26 self.ui = openerp_gtk_builder('openerp.ui', ['widget_paned'])
27 self.ui.connect_signals({


People subscribed via source and target branches