[imp] js is calling the module

bzr revid: rlo@openerp.com-20120228082226-su74ddghivymtp09
This commit is contained in:
Roberto López López (OpenERP) 2012-02-28 09:22:26 +01:00
parent af04b6860c
commit ec2ceb5d6b
1 changed files with 3 additions and 6 deletions

View File

@ -1,18 +1,15 @@
console.log('fegegegwnw')
openerp.google_docs = function(instance) {
openerp.google_docs = function(instance, session) {
console.log('nw')
instance.web.form.SidebarAttachments = instance.web.form.SidebarAttachments.extend({
init: function() {
this._super.apply(this, arguments);
this.$element.delegate('.oe_google_docs_button', 'click', this.on_add_gdoc);
this.$element.delegate('.oe_google_docs_button', 'click', this.on_add_gdoc);
},
on_add_gdoc: function() {
var self = this;
console.log('--------');
var $gdocbtn = this.$element.find('.oe_google_docs_button');
$gdocbtn.attr('disabled', 'true').find('img, span').toggle();
this.view.dataset.call_button('copy_gdoc', [[this.view.datarecord.id], this.view.dataset.get_context()], function(r) {
new openerp.sessions.session0.web.DataSet(this, 'google.docs').call_button('copy_gdoc', [[this.view.datarecord.id], this.view.dataset.get_context()], function(r) {
$gdocbtn.hide();
self.do_update();
self.do_action(r.result);