summaryrefslogtreecommitdiff
path: root/addons/google_docs
diff options
context:
space:
mode:
authorDharti Ratani (Open ERP) <dhr@tinyerp.com>2013-02-26 11:25:25 +0530
committerDharti Ratani (Open ERP) <dhr@tinyerp.com>2013-02-26 11:25:25 +0530
commitf06b26f4d591cab554a8939ed3a54928c0ba66e3 (patch)
tree3b03983b54a435eb064f9892d3f1e36af321b746 /addons/google_docs
parent6cc272049cead346d963e52e2437b54e39fa06e0 (diff)
[IMP]Creating a tempalate for automatically creating a doc
bzr revid: dhr@tinyerp.com-20130226055525-dvrlc9siy0cb8knl
Diffstat (limited to 'addons/google_docs')
-rw-r--r--addons/google_docs/google_docs.py22
-rw-r--r--addons/google_docs/res_config_user_view.xml10
2 files changed, 19 insertions, 13 deletions
diff --git a/addons/google_docs/google_docs.py b/addons/google_docs/google_docs.py
index d2e746c33e7..9aaa5b41b19 100644
--- a/addons/google_docs/google_docs.py
+++ b/addons/google_docs/google_docs.py
@@ -94,7 +94,7 @@ class google_docs_ir_attachment(osv.osv):
client = self._auth(cr, uid, context=context)
# create the document in google docs
title = "%s %s" % (context.get("name","Untitled Document."), datetime.today().strftime(DEFAULT_SERVER_DATETIME_FORMAT))
- local_resource = gdata.docs.data.Resource(gdata.docs.data.DOCUMENT_LABEL,title=title)
+ local_resource = gdata.docs.data.Resource(gdata.docs.data.SPREADSHEET_LABEL,title=title)
#create a new doc in Google Docs
gdocs_resource = client.post(entry=local_resource, uri='https://docs.google.com/feeds/default/private/full/')
# create an ir.attachment into the db
@@ -177,14 +177,18 @@ class config(osv.osv):
_columns = {
'model_id': fields.many2one('ir.model', 'Model', required=True),
- 'gdocs_resource_id': fields.char('Google Resource ID to Use as Template', size=64, help='''
-This is the id of the template document, on google side. You can find it thanks to its URL:
-*for a text document with url like `https://docs.google.com/a/openerp.com/document/d/123456789/edit`, the ID is `document:123456789`
-*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`
-*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`
-*for a drawing document with url like `https://docs.google.com/a/openerp.com/drawings/d/123456789/edit`, the ID is `drawings:123456789`
-...
-''', required=True),
+# 'gdocs_resource_id': fields.char('Google Resource ID to Use as Template', size=64, help='''
+#This is the id of the template document, on google side. You can find it thanks to its URL:
+#*for a text document with url like `https://docs.google.com/a/openerp.com/document/d/123456789/edit`, the ID is `document:123456789`
+#*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`
+#*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`
+#*for a drawing document with url like `https://docs.google.com/a/openerp.com/drawings/d/123456789/edit`, the ID is `drawings:123456789`
+#...
+#''', required=True),
+ 'gdocs_resource_id': fields.selection([('document', 'Document'),
+ ('spreadsheet', 'Spreadsheet'),
+ ('presentation', 'Presentation')], 'Type of Drive as template',
+ required=True, help="""Select here the type of drive you want as a template."""),
'name_template': fields.char('Google Drive Name Pattern', size=64, help='Choose how the new google drive will be named, on google side. Eg. gdoc_%(field_name)s', required=True),
}
diff --git a/addons/google_docs/res_config_user_view.xml b/addons/google_docs/res_config_user_view.xml
index 68cf074a4ff..268ee59801b 100644
--- a/addons/google_docs/res_config_user_view.xml
+++ b/addons/google_docs/res_config_user_view.xml
@@ -22,10 +22,11 @@
<form string="Google Drive Configuration" version="7.0">
<group>
<field name="model_id"/>
+ <field name='name_template'/>
<label for='gdocs_resource_id'/>
<div>
<field name='gdocs_resource_id'/>
- <p class="oe_grey">
+ <!-- <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>
@@ -33,10 +34,11 @@ This is the id of the template document, on google side. You can find it thanks
<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>
+ </p> -->
</div>
- <field name='name_template'/>
+
</group>
+ <button name="" string="Create a template" type="object" class="oe_highlight"/>
</form>
</field>
</record>
@@ -48,7 +50,7 @@ This is the id of the template document, on google side. You can find it thanks
<field name='view_type'>form</field>
<field name='view_id' ref='view_google_docs_config_tree'/>
</record>
- <menuitem name='Google Drive configuration' id='menu_gdocs_config' parent='document.menu_document_management_configuration'/>
+ <menuitem name='Google Drive configuration' id='menu_gdocs_config' parent='document.menu_document_doc'/>
<menuitem name='Models configuration' id='menu_gdocs_model_config' parent='menu_gdocs_config' action='action_google_docs_users_config'/>
</data>
</openerp>