[MERGE] backport of share and pad modules bugfixes

bzr revid: odo@openerp.com-20110120134858-snml4uyo0yb6mtra
This commit is contained in:
Olivier Dony 2011-01-20 14:48:58 +01:00
parent 5dbe10136c
commit f9c1dae400
4 changed files with 8 additions and 10 deletions

View File

@ -30,5 +30,6 @@ class Piratepad(openerp.controllers.SecuredController):
attachment_id = rpc.RPCProxy('ir.attachment').create({
'name': pad_name,
'url': pad_link,
'type': 'url'
}, ctx)
return {'id': attachment_id, 'name': pad_name, 'url': pad_link}

View File

@ -22,7 +22,7 @@
{
"name" : "Sharing Tools",
"version" : "1.1",
"version" : "1.2",
"depends" : ["base"],
"author" : "OpenERP SA",
"category": 'Generic Modules',

View File

@ -13,18 +13,15 @@ class ShareWizardController(openerp.controllers.SecuredController):
_cp_path = "/share"
@expose()
def index(self, domain, search_domain, context, name):
def index(self, domain, search_domain, context, view_id):
context = ast.literal_eval(context)
view_name = context.get('_terp_view_name') or name
if not view_name: return
action_id = rpc.RPCProxy('ir.actions.actions').search(
[('name','=',view_name)], 0, 0, 0, context)
if not action_id: return
action_id = rpc.RPCProxy('ir.actions.act_window').search(
[('view_id','=',int(view_id))], context=context)
if not action_id: return ""
domain = ast.literal_eval(domain)
search_domain = ast.literal_eval(search_domain)
domain.extend(search_domain)
domain.extend(ast.literal_eval(search_domain))
action_id = action_id[0]
share_model = 'share.wizard'

View File

@ -26,7 +26,7 @@ class ShareActionEditor(openobject.templating.TemplateEditor):
openobject.http.getURL('/share', {
context: jQuery("#_terp_context").val(),
domain: jQuery("#_terp_domain").val(),
name: jQuery("#_terp_string").val(),
view_id: jQuery("#_terp_view_id").val(),
search_domain: jQuery("#_terp_search_domain").val(),
}));
});