summaryrefslogtreecommitdiff
path: root/addons/google_docs
diff options
context:
space:
mode:
authorChristophe Matthieu <chm@openerp.com>2012-10-17 09:31:46 +0200
committerChristophe Matthieu <chm@openerp.com>2012-10-17 09:31:46 +0200
commit23e20e95d41d5435cf3e5bfd136a6f52efa8a80f (patch)
tree1969e768754adbcb6976a8b32c3eb5d35e778ac4 /addons/google_docs
parente8bd522f6be7fdeb1b7c916838193d7516833121 (diff)
parent8a38ee944e02d6cd6cb18b87b962b67e510906a9 (diff)
[MERGE] from trunk
bzr revid: chm@openerp.com-20121017073146-9m5s2hffeekmj068
Diffstat (limited to 'addons/google_docs')
-rw-r--r--addons/google_docs/__openerp__.py1
-rw-r--r--addons/google_docs/google_docs.py5
-rw-r--r--addons/google_docs/res_config_user_view.xml29
-rw-r--r--addons/google_docs/static/src/js/gdocs.js8
4 files changed, 30 insertions, 13 deletions
diff --git a/addons/google_docs/__openerp__.py b/addons/google_docs/__openerp__.py
index b02f2e912fc..8b9a4123aa9 100644
--- a/addons/google_docs/__openerp__.py
+++ b/addons/google_docs/__openerp__.py
@@ -27,7 +27,6 @@
'category': 'Tools',
'installable': True,
'auto_install': False,
- 'web': True,
'js': ['static/src/js/gdocs.js'],
'data': [
'security/ir.model.access.csv',
diff --git a/addons/google_docs/google_docs.py b/addons/google_docs/google_docs.py
index f1477f9c7f2..5ff80530c94 100644
--- a/addons/google_docs/google_docs.py
+++ b/addons/google_docs/google_docs.py
@@ -26,8 +26,11 @@ try:
from gdata.client import RequestError
from gdata.docs.service import DOCUMENT_LABEL
import gdata.auth
+ from gdata.docs.data import Resource
except ImportError:
- raise osv.except_osv(_('Google Docs Error!'), _('Please install gdata-python-client from http://code.google.com/p/gdata-python-client/downloads/list.'))
+ import logging
+ _logger = logging.getLogger(__name__)
+ _logger.warning("Please install latest gdata-python-client from http://code.google.com/p/gdata-python-client/downloads/list")
class google_docs_ir_attachment(osv.osv):
_inherit = 'ir.attachment'
diff --git a/addons/google_docs/res_config_user_view.xml b/addons/google_docs/res_config_user_view.xml
index 4aabba3ac5a..e6c4223735f 100644
--- a/addons/google_docs/res_config_user_view.xml
+++ b/addons/google_docs/res_config_user_view.xml
@@ -8,9 +8,10 @@
<field name="name">google_docs.config.tree</field>
<field name="model">google.docs.config</field>
<field name="arch" type="xml">
- <group name="default_filters" position="inside">
+ <tree string="Google Docs Configuration">
<field name="model_id"/>
- </group>
+ <field name="name_template"/>
+ </tree>
</field>
</record>
@@ -18,11 +19,25 @@
<field name="name">google_docs.config.form</field>
<field name="model">google.docs.config</field>
<field name="arch" type="xml">
- <group colspan='4'>
- <field name="model_id"/>
- <field name='gdocs_resource_id'/>
- <field name='name_template'/>
- </group>
+ <form string="Google Docs Configuration" version="7.0">
+ <group>
+ <field name="model_id"/>
+ <label for='gdocs_resource_id'/>
+ <div>
+ <field name='gdocs_resource_id'/>
+ <p class="oe_grey">
+This is the id of the template document, on google side. You can find it thanks to its URL:
+<ul>
+<li>for a text document with url like `https://docs.google.com/a/openerp.com/document/d/123456789/edit`, the ID is `document:123456789`</li>
+<li>for a spreadsheet document with url like `https://docs.google.com/a/openerp.com/spreadsheet/ccc?key=123456789#gid=0`, the ID is `spreadsheet:123456789`</li>
+<li>for a presentation (slide show) document with url like `https://docs.google.com/a/openerp.com/presentation/d/123456789/edit#slide=id.p`, the ID is `presentation:123456789`</li>
+<li>for a drawing document with url like `https://docs.google.com/a/openerp.com/drawings/d/123456789/edit`, the ID is `drawings:123456789`</li>
+</ul>
+ </p>
+ </div>
+ <field name='name_template'/>
+ </group>
+ </form>
</field>
</record>
diff --git a/addons/google_docs/static/src/js/gdocs.js b/addons/google_docs/static/src/js/gdocs.js
index bcfd24f8c0d..2aafdd3de4b 100644
--- a/addons/google_docs/static/src/js/gdocs.js
+++ b/addons/google_docs/static/src/js/gdocs.js
@@ -22,7 +22,7 @@ var _t = instance.web._t;
var form = self.getParent();
form.sidebar_context().then(function (context) {
var ds = new instance.web.DataSet(this, 'ir.attachment', context);
- ds.call('google_doc_get', [form.dataset.model, [form.datarecord.id], context], function(r) {
+ ds.call('google_doc_get', [form.dataset.model, [form.datarecord.id], context]).then(function(r) {
if (r == 'False') {
var params = {
error: response,
@@ -35,7 +35,7 @@ var _t = instance.web._t;
}
form.reload();
});
- })
+ });
}
- })
-}
+ });
+};