2
2
from xml .etree import ElementTree
3
3
4
4
import openerp
5
- from openerp .addons .web import nonliterals
6
5
from openerp .addons .web .controllers .main import load_actions_from_ir_values
7
6
8
7
class Board (openerp .addons .web .http .Controller ):
@@ -11,16 +10,8 @@ class Board(openerp.addons.web.http.Controller):
11
10
@openerp .addons .web .http .jsonrequest
12
11
def add_to_dashboard (self , req , menu_id , action_id , context_to_save , domain , view_mode , name = '' ):
13
12
# FIXME move this method to board.board model
14
- to_eval = nonliterals .CompoundContext (context_to_save )
15
- to_eval .session = req .session
16
- ctx = dict ((k , v ) for k , v in to_eval .evaluate ().iteritems ()
17
- if not k .startswith ('search_default_' ))
18
- ctx ['dashboard_merge_domains_contexts' ] = False # TODO: replace this 6.1 workaround by attribute on <action/>
19
- domain = nonliterals .CompoundDomain (domain )
20
- domain .session = req .session
21
- domain = domain .evaluate ()
22
-
23
- dashboard_action = load_actions_from_ir_values (req , 'action' , 'tree_but_open' , [('ir.ui.menu' , menu_id )], False )
13
+ dashboard_action = load_actions_from_ir_values (
14
+ req , 'action' , 'tree_but_open' , [('ir.ui.menu' , menu_id )], False )
24
15
25
16
if dashboard_action :
26
17
action = dashboard_action [0 ][2 ]
@@ -36,7 +27,7 @@ def add_to_dashboard(self, req, menu_id, action_id, context_to_save, domain, vie
36
27
'name' : str (action_id ),
37
28
'string' : name ,
38
29
'view_mode' : view_mode ,
39
- 'context' : str (ctx ),
30
+ 'context' : str (context_to_save ),
40
31
'domain' : str (domain )
41
32
})
42
33
column .insert (0 , new_action )
@@ -45,6 +36,6 @@ def add_to_dashboard(self, req, menu_id, action_id, context_to_save, domain, vie
45
36
'user_id' : req .session ._uid ,
46
37
'ref_id' : view_id ,
47
38
'arch' : arch
48
- }, req .session . eval_context ( req . context ) )
39
+ }, req .context )
49
40
50
41
return False
0 commit comments