[MERGE] backport of share and pad modules bugfixes
authorOlivier Dony <odo@openerp.com>
Thu, 20 Jan 2011 13:48:58 +0000 (14:48 +0100)
committerOlivier Dony <odo@openerp.com>
Thu, 20 Jan 2011 13:48:58 +0000 (14:48 +0100)
bzr revid: odo@openerp.com-20110120134858-snml4uyo0yb6mtra

addons/pad/web/controllers.py
addons/share/__openerp__.py
addons/share/web/controllers.py
addons/share/web/editors.py

index faa5d0a..1553d72 100644 (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}
index 2aae435..ff380c2 100644 (file)
@@ -22,7 +22,7 @@
 
 {
     "name" : "Sharing Tools",
-    "version" : "1.1",
+    "version" : "1.2",
     "depends" : ["base"],
     "author" : "OpenERP SA",
     "category": 'Generic Modules',
index de44d0e..b64d86c 100644 (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'
index d156d40..28e7747 100644 (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(),
                                    }));
                                });