[IMP] change js remove unusfull code and the file name configuration
bzr revid: mva@openerp.com-20120330145149-04gqj8lvleb9pa53
This commit is contained in:
@@ -8,36 +8,28 @@ openerp.google_docs = function(instance, session) {
|
||||
var self = this;
|
||||
var config = new instance.web.DataSet(this, 'google.docs.config', this.view.dataset.get_context());
|
||||
config.call('get_config', [this.view.dataset.ids[this.view.dataset.index]], function(r) {
|
||||
console.log(r);
|
||||
// if the configuration isn't set, the buttons should be hidden.
|
||||
if (r==false) {
|
||||
$('.oe_google_docs_text_button').css('display', 'none');
|
||||
$('.oe_google_docs_text_button',this.$element).hide();
|
||||
return;
|
||||
}
|
||||
|
||||
var attachment = new instance.web.DataSet(this, 'ir.attachment', self.view.dataset.get_context());
|
||||
attachment.call('copy_gdoc', [self.view.dataset.model, [self.view.datarecord.id]], function(res) {
|
||||
console.log(res);
|
||||
});
|
||||
});
|
||||
},
|
||||
start: function() {
|
||||
this._super();
|
||||
console.log($('.oe_google_docs_text_button',this.$element))
|
||||
$('.oe_google_docs_text_button',this.$element)
|
||||
},
|
||||
on_add_text_gdoc: function() {
|
||||
var self = this;
|
||||
var $gdocbtn = this.$element.find('.oe_google_docs_text_button');
|
||||
$gdocbtn.attr('disabled', 'true').find('img, span').toggle();
|
||||
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], 'text'], function(r) {
|
||||
console.log(r);
|
||||
if (r == 'False') {
|
||||
var params = {
|
||||
error: response,
|
||||
message: "The user google credentials are not set yet. Contact your administrator for help."
|
||||
}
|
||||
$(openerp.web.qweb.render("DialogWarning", params)).dialog({
|
||||
title: "User Google credentials are not yet set.",
|
||||
modal: true,
|
||||
});
|
||||
}
|
||||
self.do_update();
|
||||
});
|
||||
},
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
<t t-extend="FormView.sidebar.attachments">
|
||||
<t t-jquery="div.oe-binary-file-set" t-operation="append">
|
||||
<button class="oe_google_docs_text_button" type="button">
|
||||
<span>Add A Goole Docs</span>
|
||||
<img src="/web/static/src/img/throbber.gif" width="16" height="16" style="display: none"/>
|
||||
<span>Goole Docs</span>
|
||||
</button>
|
||||
</t>
|
||||
</t>
|
||||
|
||||
Reference in New Issue
Block a user