it-projects-llc / odoo-saas-tools

Odoo SaaS Tools — tools for SaaS Businesses. Sale and manage Odoo databases.
https://saas.it-projects.info
GNU Lesser General Public License v3.0
542 stars 577 forks source link

Can't call client methods because of the request #845

Open BettoISC opened 4 years ago

BettoISC commented 4 years ago

when we use the config wizard to execute a method it throws an error, checking the code, we think maybe using the client_env this problem could be solved.

getattr(client_env[model], method)()

odoo.addons.saas_server.controllers.main: global name 'request' is not defined Traceback (most recent call last): File "/opt/odoo/addons/10.0/odoo-saas-tools/saas_server/controllers/main.py", line 23, in wrap return f(*args, kw) File "/opt/odoo/addons/10.0/odoo-saas-tools/saas_server/controllers/main.py", line 142, in upgrade_database result = client.upgrade_database(data=state.get('data')) File "/opt/odoo/addons/10.0/odoo-saas-tools/saas_server/models/saas_server.py", line 253, in upgrade_database return self._upgrade_database(env, kwargs) File "/opt/odoo/addons/10.0/odoo-saas-tools/saas_server/models/saas_server.py", line 287, in _upgrade_database getattr(request.registry[model], method)() NameError: global name 'request' is not defined

https://github.com/it-projects-llc/odoo-saas-tools/blob/3881f0036a10a9d659d51549b1cb9e53440fdadb/saas_server/models/saas_server.py#L287

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/86095578-can-t-call-client-methods-because-of-the-request?utm_campaign=plugin&utm_content=tracker%2F3643037&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F3643037&utm_medium=issues&utm_source=github).