summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Simonis <chs@openerp.com>2014-03-05 12:41:10 +0100
committerChristophe Simonis <chs@openerp.com>2014-03-05 12:41:10 +0100
commit2ab0441ec2778be349bc312f967a60a9d06bce48 (patch)
tree03f6020b07dbc170a21bfcf871c08502d4d5a421
parentb54b8681a0daf4978a1cf20b99d44fc8066a98a4 (diff)
[FIX] auth_oauth: reset openerp oauth client_id when generating new dbuuid
bzr revid: chs@openerp.com-20140305114110-ym3c0x3muc34ep7b
-rw-r--r--addons/auth_oauth/__init__.py1
-rw-r--r--addons/auth_oauth/ir_configparameter.py14
2 files changed, 15 insertions, 0 deletions
diff --git a/addons/auth_oauth/__init__.py b/addons/auth_oauth/__init__.py
index a56db75633b..08c1dd3d6b5 100644
--- a/addons/auth_oauth/__init__.py
+++ b/addons/auth_oauth/__init__.py
@@ -2,3 +2,4 @@ import controllers
import auth_oauth
import res_users
import res_config
+import ir_configparameter
diff --git a/addons/auth_oauth/ir_configparameter.py b/addons/auth_oauth/ir_configparameter.py
new file mode 100644
index 00000000000..b0fa17ffa5b
--- /dev/null
+++ b/addons/auth_oauth/ir_configparameter.py
@@ -0,0 +1,14 @@
+# -*- coding: utf-8 -*-
+from openerp import SUPERUSER_ID
+from openerp.osv import osv
+
+class ir_configparameter(osv.Model):
+ _inherit = 'ir.config_parameter'
+
+ def init(self, cr, force=False):
+ super(ir_configparameter, self).init(cr, force=force)
+ if force:
+ IMD = self.pool['ir.model.data']
+ oauth_oe = IMD.xmlid_to_object(cr, SUPERUSER_ID, 'auth_oauth.provider_openerp')
+ dbuuid = self.get_param(cr, SUPERUSER_ID, 'database.uuid')
+ oauth_oe.write({'client_id': dbuuid})