Mohammed Shekha(Open ERP) has proposed merging 
lp:~openerp-dev/openobject-client-web/6.0-opw-31166-msh into 
lp:openobject-client-web/6.0.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-opw-31166-msh/+merge/81945

Hello,

Fixed the issue of wrong view open in log link when save the form.

Demo : Sale -> Sale Order -> Create Sale order with Sale Order Line -> Confirm 
It.
Now click on "Delivery Order 'OUT/000XX' is scheduled for the XX/XX/20XX" log 
link.
This link will open Delivery order but when you save it it will open picking 
list form.

Reason : There are many Form view and Tree View defined on stock.picking, Here 
we are sending view_id in context from log_picking method but due to the web 
architecture it will load right view first time due to followint code in screen 
at lin no 117 and 118.
if ctx.get('view_id'):
    view_id = ctx['view_id'] 

But due to line no 120 and 121 the view_id of ctx is pop to open proper tree 
view, if we will not pop it we will not able to open tree view.

So due to the line no 120 and 121 we have pop the view_id so when user will 
clicks "Save" button view_id will passed False because self.view_id = 
self.view_ids[idx] line no. 73.

So here I have keep the ctx['view_id'] in self.view_ids so when user clicks on 
save the view_id is came from self.view_ids and proper view is loaded.

Thanks.
-- 
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-opw-31166-msh/+merge/81945
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-client-web/6.0-opw-31166-msh.
=== modified file 'addons/openerp/widgets/screen.py'
--- addons/openerp/widgets/screen.py	2011-02-08 12:22:33 +0000
+++ addons/openerp/widgets/screen.py	2011-11-11 07:48:24 +0000
@@ -116,6 +116,7 @@
             ctx.update(self.context)
             if ctx.get('view_id'):
                 view_id = ctx['view_id']
+                self.view_ids = [ctx['view_id']]
                 if 'view_id' in cherrypy.request.terp_params['_terp_context']:
                     cherrypy.request.terp_params['_terp_context'].pop('view_id')
             view = cache.fields_view_get(self.model, view_id or False, view_type, ctx, self.hastoolbar, self.hassubmenu)

_______________________________________________
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