[FIX] Fixed share action according to framework,share_root_url.
bzr revid: vda@tinyerp.com-20101120070051-vnlh1dp99shaxpoa
This commit is contained in:
parent
15f8f81e05
commit
4342ea1252
|
@ -15,7 +15,6 @@ class Piratepad(openerp.controllers.SecuredController):
|
|||
domain = ast.literal_eval(domain)
|
||||
search_domain = ast.literal_eval(search_domain)
|
||||
domain.extend(search_domain)
|
||||
|
||||
context = ast.literal_eval(context)
|
||||
view_name = context.get('_terp_view_name') or name
|
||||
if view_name:
|
||||
|
@ -23,11 +22,10 @@ class Piratepad(openerp.controllers.SecuredController):
|
|||
if action_id:
|
||||
action_id = action_id[0]
|
||||
share_model = 'share.wizard'
|
||||
share_root_url = cherrypy.config.get('server.socket_host') + ':' + str(cherrypy.config.get('server.socket_port'))
|
||||
share_root_url = cherrypy.request.base
|
||||
|
||||
share_wiz_id = rpc.RPCProxy('ir.ui.menu').search([('name','=', 'Share Wizard')])
|
||||
context.update({'active_ids': share_wiz_id, 'active_id': share_wiz_id[0], '_terp_view_name': 'Share Wizard', 'share_root_url': share_root_url})
|
||||
sharing_view_id = rpc.RPCProxy(share_model).create({'domain': str(domain), 'action_id':action_id}, context)
|
||||
|
||||
return actions.execute(rpc.session.execute('object', 'execute', share_model, 'go_step_1', [sharing_view_id], context), ids=[sharing_view_id], context=context)
|
||||
|
||||
|
|
|
@ -20,12 +20,13 @@ class SidebarTemplateEditor(openobject.templating.TemplateEditor):
|
|||
</ul>
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function() {
|
||||
$share = jQuery('#sharing').click(function(){
|
||||
var $share = jQuery('#sharing').click(function(){
|
||||
var _domain = jQuery('#_terp_domain').val();
|
||||
var _search_domain = jQuery('#_terp_search_domain').val();
|
||||
var _context = jQuery('#_terp_context').val();
|
||||
var _view_name = jQuery('#_terp_string').val();
|
||||
window.open(openobject.http.getURL('/share', {domain: _domain, search_domain: _search_domain, context: _context, name: _view_name}));
|
||||
openLink(openobject.http.getURL('/share', {domain: _domain, search_domain: _search_domain, context: _context, name: _view_name}));
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue