Hi,
right now I'm trying to import a class from another module and use it. The code is as following
import importlib
cooperative_management = importlib.import_module('\odoo.addons.cooperative-management')
class ApiExample(http.Controller):
@http.route('/oauth-api/oauth-api/', auth='public')
def index(self, **kw):
try:
test = cooperative_management.controllers.quotasManagement()
except Exception as e:
body = { 'error': { 'code':500, "message":str(e), "type": type(e).__name__, "filename":__file__, "line": e.__traceback__.tb_lineno } }
return body
If I invoke the previous method, even with try catch, it always returns 500: internal error but doesn't return the custom error from the except.