[FIX] auth_oauth: reset openerp oauth client_id when generating new dbuuid
bzr revid: chs@openerp.com-20140305114110-ym3c0x3muc34ep7b
This commit is contained in:
parent
b54b8681a0
commit
2ab0441ec2
|
@ -2,3 +2,4 @@ import controllers
|
||||||
import auth_oauth
|
import auth_oauth
|
||||||
import res_users
|
import res_users
|
||||||
import res_config
|
import res_config
|
||||||
|
import ir_configparameter
|
||||||
|
|
|
@ -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})
|
Loading…
Reference in New Issue