4 from openobject import rpc
5 from openobject.tools import expose, ast
7 import openerp.controllers
11 class ShareWizardController(openerp.controllers.SecuredController):
15 def index(self, domain, context, view_id, search_domain='[]', action_id=None):
16 context = ast.literal_eval(context)
19 # This should not be needed anymore, but just in case users are
20 # running the module with an older version of the web client...
23 action_id = rpc.RPCProxy('ir.actions.act_window').search(
24 [('view_id','=',int(view_id))], context=context)
25 if not action_id: return ""
27 action_id = action_id[0]
29 domain = ast.literal_eval(domain)
30 domain.extend(ast.literal_eval(search_domain))
32 scheme, netloc, _, _, _ = urlparse.urlsplit(cherrypy.request.base)
33 share_root_url = urlparse.urlunsplit((
34 scheme, netloc, '/openerp/login',
35 'db=%(dbname)s&user=%(login)s&password=%(password)s', ''))
38 #active_ids=share_wiz_id,
39 #active_id=share_wiz_id[0],
40 _terp_view_name='Share Wizard',
41 share_root_url=share_root_url)
42 Share = rpc.RPCProxy('share.wizard')
43 sharing_view_id = Share.create({
44 'domain': str(domain),
45 'action_id': action_id and int(action_id)
47 return openerp.controllers.actions.execute(
48 Share.go_step_1([sharing_view_id], context),
49 ids=[sharing_view_id], context=context)