summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorParth Gajjar (Open ERP) <pga@tinyerp.com>2013-05-22 15:58:57 +0530
committerParth Gajjar (Open ERP) <pga@tinyerp.com>2013-05-22 15:58:57 +0530
commitb4e6c2109c715c66e14e6f99446fda6da7e5b433 (patch)
tree499b4d7e59e7da1bd43fe16f9b20bcb15187449c
parent17da5c010609bc74cb69a1331a16d6a2e426d110 (diff)
[IMP]Google client id in ir.config_parameter
bzr revid: pga@tinyerp.com-20130522102857-fehfsdks1fq3zc1i
-rw-r--r--addons/google_docs/google_docs.py10
-rw-r--r--addons/google_docs/google_docs_demo.xml6
-rw-r--r--addons/google_docs/res_config_user_view.xml14
3 files changed, 8 insertions, 22 deletions
diff --git a/addons/google_docs/google_docs.py b/addons/google_docs/google_docs.py
index f3d3ad72198..aea5ec35037 100644
--- a/addons/google_docs/google_docs.py
+++ b/addons/google_docs/google_docs.py
@@ -126,8 +126,8 @@ class config(osv.osv):
def _client_id_get(self, cr, uid, ids, name, arg, context=None):
result = {}
for config_id in ids:
- user = self.pool.get('res.users').browse(cr, SUPERUSER_ID, uid)
- result[config_id] = user.company_id.google_client_id
+ config = self.pool['ir.config_parameter']
+ result[config_id] = config.get_param(cr, SUPERUSER_ID, 'google_client_id')
return result
_columns = {
@@ -163,9 +163,3 @@ class config(osv.osv):
]
config()
-
-class res_company(osv.osv):
- _inherit = "res.company"
- _columns = {
- 'google_client_id': fields.char('Google Client ID', size=200, help="Go to 'Google APIs console' and create 'OAuth 2.0 Client ID'."),
- } \ No newline at end of file
diff --git a/addons/google_docs/google_docs_demo.xml b/addons/google_docs/google_docs_demo.xml
index fb452bf68e8..b37f8713ec9 100644
--- a/addons/google_docs/google_docs_demo.xml
+++ b/addons/google_docs/google_docs_demo.xml
@@ -19,7 +19,11 @@
<field name="gdocs_template_url">https://docs.google.com/spreadsheet/ccc?key=0Ah2qnrLAoZmUdGRvdVdmS1VoSDctWk1kd18taGZ4ckE#gid=0</field>
<field name="name_template">%(name)s_%(model)s_%(filter)s_gdrive</field>
</record>
-
+
+ <record id="template_google_client_id" model="ir.config_parameter">
+ <field name="key">google_client_id</field>
+ <field name="value">-</field>
+ </record>
</data>
</openerp>
diff --git a/addons/google_docs/res_config_user_view.xml b/addons/google_docs/res_config_user_view.xml
index 93f37ce8d09..3e875ddc897 100644
--- a/addons/google_docs/res_config_user_view.xml
+++ b/addons/google_docs/res_config_user_view.xml
@@ -81,19 +81,7 @@
</field>
</record>
- <record model="ir.ui.view" id="view_company_inherit_form2">
- <field name="name">res.company.form.inherit</field>
- <field name="inherit_id" ref="base.view_company_form" />
- <field name="model">res.company</field>
- <field name="arch" type="xml">
- <xpath expr="//group[@name='account_grp']" position="after">
- <group string="Google Configuration">
- <field name='google_client_id' />
- </group>
- </xpath>
- </field>
- </record>
-
+
<menuitem name='Google Drive configuration' id='menu_gdocs_config' parent='base.menu_administration' />
<menuitem id='menu_gdocs_model_config' parent='menu_gdocs_config' action='action_google_docs_users_config' />
</data>