From 1ade3b205fc01dc4d476fa295d8e046a44755b19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20L=C3=B3pez=20L=C3=B3pez=20=28OpenERP=29?= Date: Wed, 29 Feb 2012 18:23:19 +0100 Subject: [PATCH] [fix] bzr revid: rlo@openerp.com-20120229172319-rzwcu1egrhw9ggms --- addons/google_docs/google_docs.py | 9 +++++---- addons/google_docs/static/src/js/gdocs.js | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/addons/google_docs/google_docs.py b/addons/google_docs/google_docs.py index e253d62ffbb..b60acd16197 100644 --- a/addons/google_docs/google_docs.py +++ b/addons/google_docs/google_docs.py @@ -55,11 +55,12 @@ class google_docs_config(osv.osv): class google_docs(osv.osv): _name = 'google.docs' - - def doc_get(self, cr, uid, model, id, context=None): + def doc_get(self, cr, uid, model, ids, context=None): google_docs_ref = self.pool.get('google.docs.config') - gdocs_resource_id = google_docs_ref.search(cr, uid, [('model', '=', model)]) - + gdocs_resource_id = google_docs_ref.search(cr, uid, [('model', '=', model), ('id', 'in', ids)]) + #print gdocs_resource_id + #print google_docs_ref.edit_url_template % (gdocs_resource_id, ) + #import pdb; pdb.set_trace() if gdocs_resource_id: return google_docs_ref.edit_url_template % (gdocs_resource_id, ) else: diff --git a/addons/google_docs/static/src/js/gdocs.js b/addons/google_docs/static/src/js/gdocs.js index 14103681306..a126bfed5c3 100644 --- a/addons/google_docs/static/src/js/gdocs.js +++ b/addons/google_docs/static/src/js/gdocs.js @@ -9,8 +9,8 @@ instance.web.form.SidebarAttachments = instance.web.form.SidebarAttachments.exte var self = this; var $gdocbtn = this.$element.find('.oe_google_docs_button'); $gdocbtn.attr('disabled', 'true').find('img, span').toggle(); - new openerp.sessions.session0.web.DataSet(this, 'google.docs').call('doc_get', [this.view.datarecord.id, this.view.dataset.get_context()], function(r) { - console.log(r); + var ds = new instance.web.DataSet(this, 'google.docs', this.view.dataset.get_context()); + ds.call('doc_get', [this.view.dataset.model, [this.view.datarecord.id]], function(r) { self.do_update(); }); }