[IMP] Improved Code
bzr revid: pga@tinyerp.com-20130529074629-4x7dooxgbq5g6hdc
This commit is contained in:
@@ -97,10 +97,8 @@ class config(osv.osv):
|
||||
attach_vals = {'res_model': res_model, 'name': name_gdocs, 'res_id': res_id, 'type': 'url', 'url':content['alternateLink']}
|
||||
attach_pool.create(cr, uid, attach_vals)
|
||||
res = content['alternateLink']
|
||||
elif uid==1:
|
||||
raise self.pool.get('res.config.settings').get_config_warning(cr, _("You haven't configured 'Authorization Code' generated from google, Please generate and configure it in %%(menu:base_setup.menu_general_configuration)s."), context=context)
|
||||
else:
|
||||
raise osv.except_osv(_('Google Drive Configuration Error!'), _("'Authorization Code' is not configured yet, Please Contact Administrator"))
|
||||
raise self.pool.get('res.config.settings').get_config_warning(cr, _("You haven't configured 'Authorization Code' generated from google, Please generate and configure it in %%(menu:base_setup.menu_general_configuration)s."), context=context)
|
||||
return res
|
||||
|
||||
def get_google_docs_config(self, cr, uid, res_model, res_id, context=None):
|
||||
|
||||
@@ -76,6 +76,7 @@
|
||||
<xpath expr="//div[@name='google_docs']" position="after">
|
||||
<div attrs="{'invisible': [('module_google_docs','=',False)]}">
|
||||
<p class="oe_gray" >
|
||||
<!-- Need to generate client id, redirect url from Google Account (API console) and replace below link. Limitation on Number of request: 10 lacks per day. -->
|
||||
Click here to <a href="https://accounts.google.com/o/oauth2/auth?scope=https://www.googleapis.com/auth/drive&redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=code&client_id=39623646228-eg3ggo3mk6o40m7rguobi3rkl9frh4tb.apps.googleusercontent.com" target="_blank"><b>Generate Google Authorization Code</b></a><br/>
|
||||
<group>
|
||||
<field name="authorization_code" on_change="onchange_authorization_code(authorization_code)"/>
|
||||
|
||||
Reference in New Issue
Block a user