parent
67ffbbac7a
commit
1ade3b205f
|
@ -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:
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue