Skip to Content
Menu
This question has been flagged
2 Replies
2668 Views

Hey there ,

I am using odoo community version 10.0 edition for windows ,

By mistake , I have removed settings rights from administrator side

Now what is the best way to recover it again ?

Please guide me step wise

Avatar
Discard

any other user have settings access right

Best Answer

I have an idea by using this one it will work.

Create another Database, from this database using custom module or existing module we can do it

(By using any existing button action from the current DB also we can do)

create a button in your module, by using this button action we can connect with Setting last DB.


see the following code how to connect a DB from another DB.


from openerp import api,  models

import xmlrpclib

class CustomModel(models.Model):

    _name = "custom.model"

    

    @api.model

    def update_details(self):

        url = 'http://localhost:8069'

        db = "your db name"  ## where you removed Settings

        username = "admin"

        password = "adminpwd"


        common = xmlrpclib.ServerProxy('{}/xmlrpc/2/common'.format(url))

        common.version()

        uid = common.authenticate(db, username, password, {})

        models = xmlrpclib.ServerProxy('{}/xmlrpc/2/object'.format(url))

        models.execute_kw(db, uid, password, 'res.users', 'write', [[1], {'sel_groups_1_2_3': 3}])


I hope you problem will solve with this

Avatar
Discard

why I am choosing this one is, only write method will solve your problem