Yenthe666 / Odoo_Samples

This repository contains samples with Odoo code
GNU Affero General Public License v3.0
241 stars 306 forks source link

ERPpeek AccessDenied #14

Closed warrag closed 4 years ago

warrag commented 4 years ago

Hello every one

When I am using this lib I got xmlrpc.client.Fault: <Fault AccessDenied: 'Access denied'>

@Yenthe666 please any help with this

best regards

Yenthe666 commented 4 years ago

Show an example of the code please :)

warrag commented 4 years ago

@Yenthe666 this is the code

`def write(self, values):

    DATABASE = 'db_name'
    SERVER = self.env["ir.config_parameter"].get_param("server")
    ADMIN_PASSWORD = self.randomStringDigits()

    client = erppeek.Client(server=SERVER)

    if not DATABASE in client.db.list():
        print("The database does not exist yet, creating one!")
        client.create_database(ADMIN_PASSWORD, DATABASE)
    else:
        print("The database " + DATABASE + " already exists.")

    res = super(SaleOrder, self).write(values)
    return res`

this issue it's come in client.create_database(ADMIN_PASSWORD, DATABASE)

Yenthe666 commented 4 years ago

I might be missing something but I think you've set a master password which you're not setting in the script?

warrag commented 4 years ago

Thanks a lot it's work now

Yenthe666 commented 4 years ago

Awesome, have fun :)

yenykm commented 3 years ago

Had the same problem ... you guys saved my night. Thanks a lot.

Krishna-Sharma-BSI commented 11 months ago

hi @Yenthe666 @warrag @yenykm I am having same issue in version 15.0 while trying to access through python script in odoo.conf admin_passwd is admin I have use same DATABASE = db_name SERVER = 'http://localhost:8069' ADMIN_PASSWORD = 'admin' client = erppeek.Client(server=SERVER) client.create_database(ADMIN_PASSWORD,DATABASE) but getting issue, can someone guide me please ?