Mohammed Shekha(Open ERP) has proposed merging 
lp:~openerp-dev/openerp-web/6.1-opw-576380-msh into lp:openerp-web/6.1.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/6.1-opw-576380-msh/+merge/115069

Hello,

Fixed the issue of active_id and active_ids, if there is not active_id or 
active_ids in context so passed False and [] respectively.

Demo ->  Marketing/Reporting/Event Dashboard.
Got Error of active_id.

Generally this issue is not generated as we will not have any action on menu 
where we have passed active_id or active_ids which obvious thing that while we 
calling menu_action at that time we will not have the active_id or active_ids, 
but here why we are facing this issue is due to addons code, where we have 
reused the action defined for act_window, we have reused the action 
"act_event_list_register_event" defined for act_window in menu action board 
view, the action will work for act_window as there will be any active_record 
when you going to call act_window but this will not be true for menu action.

Hence to make the same behaviour as GTK sets False and [] for active_id and 
active_ids respectively, so that when action is reused it should not give error 
of context evaluation.

Thanks.
-- 
https://code.launchpad.net/~openerp-dev/openerp-web/6.1-opw-576380-msh/+merge/115069
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openerp-web/6.1-opw-576380-msh.
=== modified file 'addons/web/controllers/main.py'
--- addons/web/controllers/main.py	2012-06-29 09:57:53 +0000
+++ addons/web/controllers/main.py	2012-07-16 06:46:52 +0000
@@ -685,6 +685,10 @@
 
     if not do_not_eval:
         # values come from the server, we can just eval them
+        if 'active_id' not in eval_ctx:
+            eval_ctx['active_id'] = False
+        if 'active_ids' not in eval_ctx:
+            eval_ctx['active_ids'] = []
         if action.get('context') and isinstance(action.get('context'), basestring):
             action['context'] = eval( action['context'], eval_ctx ) or {}
 

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to