#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,
: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')
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:
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),
*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 = {
<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>
<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'/>
<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>