c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #02027
[Bug 669920] [NEW] [6.0RC1][WISH] Allow to select a view depend of record selected
Public bug reported:
Hi
I need to show different view based on the category of partner, i
can do it with my menu link, but if i go in sale order and click on the
partner link, view selected by priority.
The active_id not pass in context to function fields_view_get, so
... if i want select view i need the active_id record.
my pacth to do it
client-web/addons/openerp/widgets/screen.py
def add_view_id(self, view_id, view_type):
self.view_id = view_id
if view_type in self.views_preloaded:
view = self.views_preloaded[view_type]
else:
ctx = rpc.session.context.copy()
ctx.update(self.context)
+ ctx['active_id'] = self.id and self.id or False
+ ctx['active_ids'] = self.ids and self.ids or False
if ctx.get('view_id'):
view_id = ctx['view_id']
view = cache.fields_view_get(self.model, view_id, view_type, ctx, self.hastoolbar, self.hassubmenu)
self.add_view(view, view_type)
So now in my addons module in server, i can override the function fields_view_get in res.partner to select view based on the category of the partner.
I hope you can add this in next version.
** Affects: openobject-client-web
Importance: Undecided
Status: New
** Summary changed:
- [RC1][WISH] Allow to select a view depend of record selected
+ [6.0RC1][WISH] Allow to select a view depend of record selected
--
[6.0RC1][WISH] Allow to select a view depend of record selected
https://bugs.launchpad.net/bugs/669920
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
Status in OpenObject Web Client: New
Bug description:
Hi
I need to show different view based on the category of partner, i can do it with my menu link, but if i go in sale order and click on the partner link, view selected by priority.
The active_id not pass in context to function fields_view_get, so ... if i want select view i need the active_id record.
my pacth to do it
client-web/addons/openerp/widgets/screen.py
def add_view_id(self, view_id, view_type):
self.view_id = view_id
if view_type in self.views_preloaded:
view = self.views_preloaded[view_type]
else:
ctx = rpc.session.context.copy()
ctx.update(self.context)
+ ctx['active_id'] = self.id and self.id or False
+ ctx['active_ids'] = self.ids and self.ids or False
if ctx.get('view_id'):
view_id = ctx['view_id']
view = cache.fields_view_get(self.model, view_id, view_type, ctx, self.hastoolbar, self.hassubmenu)
self.add_view(view, view_type)
So now in my addons module in server, i can override the function fields_view_get in res.partner to select view based on the category of the partner.
I hope you can add this in next version.
Follow ups
-
[Bug 669920] OpenERP Majordomo Message
From: OpenERP Majordomo, 2011-08-16
-
[Bug 669920] Re: Fields view get should send the active_id and active_ids of the current records
From: Steeve, 2011-08-05
-
[Bug 669920] Re: Fields view get should send the active_id and active_ids of the current records
From: Steeve, 2011-08-04
-
[Bug 669920] Re: Fields view get should send the active_id and active_ids of the current records
From: Steeve, 2011-08-01
-
[Bug 669920] Re: Fields view get should send the active_id and active_ids of the current records
From: Xavier (Open ERP), 2011-01-26
-
[Bug 669920] Re: [6.0RC1][WISH] Allow to select a view depend of record selected
From: sickle, 2010-12-02
-
[Bug 669920] Re: [6.0RC1][WISH] Allow to select a view depend of record selected
From: sickle, 2010-11-29
-
[Bug 669920] Re: [6.0RC1][WISH] Allow to select a view depend of record selected
From: sickle, 2010-11-29
-
[Bug 669920] Re: [6.0RC1][WISH] Allow to select a view depend of record selected
From: Serge, 2010-11-29
-
[Bug 669920] Re: [6.0RC1][WISH] Allow to select a view depend of record selected
From: Serge, 2010-11-26
-
[Bug 669920] Re: [6.0RC1][WISH] Allow to select a view depend of record selected
From: Serge, 2010-11-26
-
[Bug 669920] Re: [6.0RC1][WISH] Allow to select a view depend of record selected
From: Serge, 2010-11-26
-
[Bug 669920] Re: [6.0RC1][WISH] Allow to select a view depend of record selected
From: Serge, 2010-11-26
-
[Bug 669920] Re: [6.0RC1][WISH] Allow to select a view depend of record selected
From: Serge, 2010-11-25
-
Re: [Bug 669920] [NEW] [6.0RC1][WISH] Allow to select a view depend of record selected
From: xrg, 2010-11-25
-
[Bug 669920] Re: [6.0RC1][WISH] Allow to select a view depend of record selected
From: DBR (OpenERP), 2010-11-25
-
[Bug 669920] [NEW] [6.0RC1][WISH] Allow to select a view depend of record selected
From: Serge, 2010-11-02
References