summaryrefslogtreecommitdiff
path: root/addons/google_docs
diff options
context:
space:
mode:
authorRoberto López López (OpenERP) <rlo@openerp.com>2012-02-27 14:54:25 +0100
committerRoberto López López (OpenERP) <rlo@openerp.com>2012-02-27 14:54:25 +0100
commit95d9cb9f4ec264b0ee35fdc5bef9058d9cfdbe0b (patch)
tree340c625ca17c4010772b70049a36e5389b447a19 /addons/google_docs
parent37ed7a1d9f1819fd39cbf0eb0679ae17e1afd91a (diff)
[imp] view
bzr revid: rlo@openerp.com-20120227135425-879tmcgw20dfy2a1
Diffstat (limited to 'addons/google_docs')
-rw-r--r--addons/google_docs/__openerp__.py6
-rw-r--r--addons/google_docs/google_docs.py31
-rw-r--r--addons/google_docs/static/src/js/gdocs.js1
-rw-r--r--addons/google_docs/static/src/xml/gdocs.xml2
4 files changed, 30 insertions, 10 deletions
diff --git a/addons/google_docs/__openerp__.py b/addons/google_docs/__openerp__.py
index 2461be1e151..309ca13edc0 100644
--- a/addons/google_docs/__openerp__.py
+++ b/addons/google_docs/__openerp__.py
@@ -1,17 +1,17 @@
{
- 'name': 'Wiki',
+ 'name': 'Google Docs',
'version': '0.1',
'author': 'OpenERP SA',
'website': 'http://openerp.com',
'data': [
- 'res_gdocs.xml'
+ 'google_docs.xml'
],
'installable': True,
'auto_install': False,
'web': True,
'js': ['static/src/js/gdocs.js'],
'qweb' : [
- "static/src/xml/*.xml",
+ "static/src/xml/gdocs.xml",
],
'depends': ['google_base_account'],
'description': 'Module to attach a google document to any model.'
diff --git a/addons/google_docs/google_docs.py b/addons/google_docs/google_docs.py
index def1f3097e1..59101ba5b09 100644
--- a/addons/google_docs/google_docs.py
+++ b/addons/google_docs/google_docs.py
@@ -70,7 +70,15 @@ class google_docs(osv.osv):
'gdocs_res_id': fields.char('Google resource ID', size=64, translate=False),
'name_template': fields.char('GDoc name template', size=64, translate=False)
}
+ print '''
+#########################################
+
+GOOGLE DOCS
+
+#########################################
+
+'''
edit_url_template = 'https://docs.google.com/Edit?docid=%s'
prefix_gdoc_id_res = DOCUMENT_LABEL + ':'
@@ -84,6 +92,15 @@ class google_docs(osv.osv):
@return -1 if the template hasn't been assigned yet.
@return -2 if the google_base_account hasn't been configured yet.
'''
+ print '''
+
+#########################################
+
+google_docs.copy_gdoc()
+
+#########################################
+
+'''
if context==None:
context={}
@@ -121,14 +138,15 @@ class google_docs(osv.osv):
return self.edit_url_template % (copied_resource.resource_id.text,)
+'''
def get_documents_list(self, cr, uid, context=None):
- '''Return the list of google documents available at the user's account.
+ ' ''Return the list of google documents available at the user's account.
@param cr: the current row from the database cursor.
@param uid: the current user ID, for security checks.
@param context: a standard dictionary for contextual values.
@return a list with information about the documents in form of tuples (document_name, document_resource_id).
@return -2 if the google_base_account hasn't been configured yet.
- '''
+ '' '
if context == None:
context = {}
@@ -146,10 +164,11 @@ class google_docs(osv.osv):
client.ClientLogin(user.gmail_user, user.gmail_password, client.source, service='writely')
return map(lambda doc: (doc.title.text, doc.resource_id.text[len(prefix_gdoc_id_res):]), filter(lambda r: r.resource_id.text.startswith(prefix_gdoc_id_res), client.get_all_resources()))
+'''
-
+'''
def set_model_document_template(self, cr, uid, model, resource_id, context=None):
- '''Set the default document template for the specified model. This template doesn't have to be a google documents template itself, but just a document.
+ '' 'Set the default document template for the specified model. This template doesn't have to be a google documents template itself, but just a document.
@param cr: current row for the database cursor.
@param uid: the current user ID, for security checks.
@param model: the current model name.
@@ -158,7 +177,7 @@ class google_docs(osv.osv):
@return 0 on successful execution.
@return -2 if the google_base_account hasn't been configured yet.
@return -3 if the given resource_id doesn't exist in the user's google docs account.
- '''
+ ' ''
if context == None:
context = {}
@@ -186,7 +205,7 @@ class google_docs(osv.osv):
})
return 0
-
+'''
class google_docs_folder(osv.osv):
_name = 'google.docs.folder'
diff --git a/addons/google_docs/static/src/js/gdocs.js b/addons/google_docs/static/src/js/gdocs.js
index 30edffaad7f..579414ee74a 100644
--- a/addons/google_docs/static/src/js/gdocs.js
+++ b/addons/google_docs/static/src/js/gdocs.js
@@ -2,6 +2,7 @@ openerp.gdocs = function(instance) {
instance.web.form.SidebarAttachments = instance.web.form.SidebarAttachments.extend({
on_attachments_loaded: function(attachments) {
+ alert('gdocs.js.on_attachments_loaded()');
this._super(attachments);
var self = this;
var $gdocbtn = self.$element.find('button.gdocs');
diff --git a/addons/google_docs/static/src/xml/gdocs.xml b/addons/google_docs/static/src/xml/gdocs.xml
index bc7a56842ba..9f78a91c28f 100644
--- a/addons/google_docs/static/src/xml/gdocs.xml
+++ b/addons/google_docs/static/src/xml/gdocs.xml
@@ -4,7 +4,7 @@
<templates id="template" xml:space="preserve">
<t t-extend="FormView.sidebar.attachments">
<t t-jquery="div.oe-binary-file-set" t-operation="append">
- <button class="oe_button" type="button">
+ <button class="oe-button" type="button">
<img src="/web/static/src/img/throbber.gif" width="16" height="16" style="display: none"/>
<span>Add GDoc</span>
</button>