[IMP]Renaming google docs to google drive
bzr revid: dhr@tinyerp.com-20130225091639-s0m5xd110yozak0q
This commit is contained in:
parent
be7ea8ed2a
commit
6cc272049c
|
@ -20,7 +20,7 @@
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
{
|
{
|
||||||
'name': 'Google Docs integration',
|
'name': 'Google Drive integration',
|
||||||
'version': '0.2',
|
'version': '0.2',
|
||||||
'author': 'OpenERP SA',
|
'author': 'OpenERP SA',
|
||||||
'website': 'http://openerp.com',
|
'website': 'http://openerp.com',
|
||||||
|
|
|
@ -126,7 +126,7 @@ class google_docs_ir_attachment(osv.osv):
|
||||||
#copy the document you choose in the configuration
|
#copy the document you choose in the configuration
|
||||||
copy_resource = client.copy_resource(doc, name_gdocs)
|
copy_resource = client.copy_resource(doc, name_gdocs)
|
||||||
except:
|
except:
|
||||||
raise osv.except_osv(_('Google Docs Error!'), _("Your resource id is not correct. You can find the id in the google docs URL."))
|
raise osv.except_osv(_('Google Drive Error!'), _("Your resource id is not correct. You can find the id in the google docs URL."))
|
||||||
# create an ir.attachment
|
# create an ir.attachment
|
||||||
self.create(cr, uid, {
|
self.create(cr, uid, {
|
||||||
'res_model': res_model,
|
'res_model': res_model,
|
||||||
|
@ -150,7 +150,7 @@ class google_docs_ir_attachment(osv.osv):
|
||||||
:return: the google document object created
|
:return: the google document object created
|
||||||
'''
|
'''
|
||||||
if len(ids) != 1:
|
if len(ids) != 1:
|
||||||
raise osv.except_osv(_('Google Docs Error!'), _("Creating google docs may only be done by one at a time."))
|
raise osv.except_osv(_('Google Drive Error!'), _("Creating google drive may only be done by one at a time."))
|
||||||
res_id = ids[0]
|
res_id = ids[0]
|
||||||
pool_ir_attachment = self.pool.get('ir.attachment')
|
pool_ir_attachment = self.pool.get('ir.attachment')
|
||||||
pool_gdoc_config = self.pool.get('google.docs.config')
|
pool_gdoc_config = self.pool.get('google.docs.config')
|
||||||
|
@ -164,7 +164,7 @@ class google_docs_ir_attachment(osv.osv):
|
||||||
try:
|
try:
|
||||||
name_gdocs = name_gdocs % model_fields_dic
|
name_gdocs = name_gdocs % model_fields_dic
|
||||||
except:
|
except:
|
||||||
raise osv.except_osv(_('Key Error!'), _("Your Google Doc Name Pattern's key does not found in object."))
|
raise osv.except_osv(_('Key Error!'), _("Your Google Drive Name Pattern's key does not found in object."))
|
||||||
google_template_id = pool_gdoc_config.browse(cr, uid, google_docs_config[0], context=context).gdocs_resource_id
|
google_template_id = pool_gdoc_config.browse(cr, uid, google_docs_config[0], context=context).gdocs_resource_id
|
||||||
google_document = pool_ir_attachment.copy_gdoc(cr, uid, res_model, res_id, name_gdocs, google_template_id, context=context)
|
google_document = pool_ir_attachment.copy_gdoc(cr, uid, res_model, res_id, name_gdocs, google_template_id, context=context)
|
||||||
else:
|
else:
|
||||||
|
@ -173,7 +173,7 @@ class google_docs_ir_attachment(osv.osv):
|
||||||
|
|
||||||
class config(osv.osv):
|
class config(osv.osv):
|
||||||
_name = 'google.docs.config'
|
_name = 'google.docs.config'
|
||||||
_description = "Google Docs templates config"
|
_description = "Google Drive templates config"
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'model_id': fields.many2one('ir.model', 'Model', required=True),
|
'model_id': fields.many2one('ir.model', 'Model', required=True),
|
||||||
|
@ -185,7 +185,7 @@ This is the id of the template document, on google side. You can find it thanks
|
||||||
*for a drawing document with url like `https://docs.google.com/a/openerp.com/drawings/d/123456789/edit`, the ID is `drawings: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),
|
''', required=True),
|
||||||
'name_template': fields.char('Google Doc Name Pattern', size=64, help='Choose how the new google docs will be named, on google side. Eg. gdoc_%(field_name)s', required=True),
|
'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),
|
||||||
}
|
}
|
||||||
|
|
||||||
_defaults = {
|
_defaults = {
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<field name="name">google_docs.config.tree</field>
|
<field name="name">google_docs.config.tree</field>
|
||||||
<field name="model">google.docs.config</field>
|
<field name="model">google.docs.config</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="Google Docs Configuration">
|
<tree string="Google Drive Configuration">
|
||||||
<field name="model_id"/>
|
<field name="model_id"/>
|
||||||
<field name="name_template"/>
|
<field name="name_template"/>
|
||||||
</tree>
|
</tree>
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
<field name="name">google_docs.config.form</field>
|
<field name="name">google_docs.config.form</field>
|
||||||
<field name="model">google.docs.config</field>
|
<field name="model">google.docs.config</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Google Docs Configuration" version="7.0">
|
<form string="Google Drive Configuration" version="7.0">
|
||||||
<group>
|
<group>
|
||||||
<field name="model_id"/>
|
<field name="model_id"/>
|
||||||
<label for='gdocs_resource_id'/>
|
<label for='gdocs_resource_id'/>
|
||||||
|
@ -48,7 +48,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_type'>form</field>
|
||||||
<field name='view_id' ref='view_google_docs_config_tree'/>
|
<field name='view_id' ref='view_google_docs_config_tree'/>
|
||||||
</record>
|
</record>
|
||||||
<menuitem name='Google Docs configuration' id='menu_gdocs_config' parent='base.menu_administration'/>
|
<menuitem name='Google Drive configuration' id='menu_gdocs_config' parent='document.menu_document_management_configuration'/>
|
||||||
<menuitem name='Models configuration' id='menu_gdocs_model_config' parent='menu_gdocs_config' action='action_google_docs_users_config'/>
|
<menuitem name='Models configuration' id='menu_gdocs_model_config' parent='menu_gdocs_config' action='action_google_docs_users_config'/>
|
||||||
</data>
|
</data>
|
||||||
</openerp>
|
</openerp>
|
||||||
|
|
|
@ -3,6 +3,6 @@
|
||||||
-->
|
-->
|
||||||
<templates id="template" xml:space="preserve">
|
<templates id="template" xml:space="preserve">
|
||||||
<t t-name="AddGoogleDocumentItem">
|
<t t-name="AddGoogleDocumentItem">
|
||||||
<li class="oe_sidebar_add_google_doc"><span><b>Add Google Doc...</b></span></li>
|
<li class="oe_sidebar_add_google_doc"><span><b>Add Google Drive...</b></span></li>
|
||||||
</t>
|
</t>
|
||||||
</templates>
|
</templates>
|
||||||
|
|
Loading…
Reference in New Issue