[IMP]Renaming google docs to google drive

bzr revid: dhr@tinyerp.com-20130225091639-s0m5xd110yozak0q
This commit is contained in:
Dharti Ratani (Open ERP) 2013-02-25 14:46:39 +05:30
parent be7ea8ed2a
commit 6cc272049c
4 changed files with 10 additions and 10 deletions

View File

@ -20,7 +20,7 @@
##############################################################################
{
'name': 'Google Docs integration',
'name': 'Google Drive integration',
'version': '0.2',
'author': 'OpenERP SA',
'website': 'http://openerp.com',

View File

@ -126,7 +126,7 @@ class google_docs_ir_attachment(osv.osv):
#copy the document you choose in the configuration
copy_resource = client.copy_resource(doc, name_gdocs)
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
self.create(cr, uid, {
'res_model': res_model,
@ -150,7 +150,7 @@ class google_docs_ir_attachment(osv.osv):
:return: the google document object created
'''
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]
pool_ir_attachment = self.pool.get('ir.attachment')
pool_gdoc_config = self.pool.get('google.docs.config')
@ -164,7 +164,7 @@ class google_docs_ir_attachment(osv.osv):
try:
name_gdocs = name_gdocs % model_fields_dic
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_document = pool_ir_attachment.copy_gdoc(cr, uid, res_model, res_id, name_gdocs, google_template_id, context=context)
else:
@ -173,7 +173,7 @@ class google_docs_ir_attachment(osv.osv):
class config(osv.osv):
_name = 'google.docs.config'
_description = "Google Docs templates config"
_description = "Google Drive templates config"
_columns = {
'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`
...
''', 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 = {

View File

@ -8,7 +8,7 @@
<field name="name">google_docs.config.tree</field>
<field name="model">google.docs.config</field>
<field name="arch" type="xml">
<tree string="Google Docs Configuration">
<tree string="Google Drive Configuration">
<field name="model_id"/>
<field name="name_template"/>
</tree>
@ -19,7 +19,7 @@
<field name="name">google_docs.config.form</field>
<field name="model">google.docs.config</field>
<field name="arch" type="xml">
<form string="Google Docs Configuration" version="7.0">
<form string="Google Drive Configuration" version="7.0">
<group>
<field name="model_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_id' ref='view_google_docs_config_tree'/>
</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'/>
</data>
</openerp>

View File

@ -3,6 +3,6 @@
-->
<templates id="template" xml:space="preserve">
<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>
</templates>