diff --git a/addons/google_docs/google_docs.py b/addons/google_docs/google_docs.py
index 4059ed9117f..c570ac5dd33 100644
--- a/addons/google_docs/google_docs.py
+++ b/addons/google_docs/google_docs.py
@@ -202,8 +202,8 @@ class config(osv.osv):
config()
-class res_users(osv.osv):
- _inherit = "res.users"
+class base_config_settings(osv.osv):
+ _inherit = "base.config.settings"
def onchange_authorization_code(self, cr, uid, ids, authorization_code, context=None):
res = {}
@@ -222,7 +222,16 @@ class res_users(osv.osv):
if 'refresh_token' in content.keys():
ir_config.set_param(cr, uid, 'google_refresh_token', content['refresh_token'])
return res
+
+ def get_default_authorization_code(self, cr, uid, ids, context=None):
+ authorization_code = self.pool.get("ir.config_parameter").get_param(cr, uid, "authorization_code", context=context)
+ return {'authorization_code': authorization_code}
+ def set_authorization_code(self, cr, uid, ids, context=None):
+ config_parameters = self.pool.get("ir.config_parameter")
+ for record in self.browse(cr, uid, ids, context=context):
+ config_parameters.set_param(cr, uid, "authorization_code", record.authorization_code or '', context=context)
+
_columns = {
- 'authorization_code': fields.char('Authorization Code', size=124),
+ 'authorization_code': fields.char('Google Authorization Code', size=124),
}
\ No newline at end of file
diff --git a/addons/google_docs/google_docs_data.xml b/addons/google_docs/google_docs_data.xml
index ea8d5dcd8ba..5ec29c12a7c 100644
--- a/addons/google_docs/google_docs_data.xml
+++ b/addons/google_docs/google_docs_data.xml
@@ -22,5 +22,9 @@
-
+
+ authorization_code
+ -
+
\ No newline at end of file
diff --git a/addons/google_docs/res_config_user_view.xml b/addons/google_docs/res_config_user_view.xml
index ea796ee34b8..2e3d833814b 100644
--- a/addons/google_docs/res_config_user_view.xml
+++ b/addons/google_docs/res_config_user_view.xml
@@ -76,19 +76,7 @@
-
-
-
-
-
-
- res.users.google.form1
- res.users
-
-
-
-
-
+
@@ -96,20 +84,7 @@
Generate Authorization Code
-
-
-
-
-
- res.users.google.form2
- res.users
-
-
-
-
-
- Generate Authorization Code
-
+
diff --git a/addons/google_docs/static/src/img/icon.png b/addons/google_docs/static/src/img/icon.png
new file mode 100644
index 00000000000..e7f64291ef9
Binary files /dev/null and b/addons/google_docs/static/src/img/icon.png differ