Change CI to GitHub actions

Use copier template from oca/oca-addons-repo-template

Target Python3.8

Apply linting

Fix a missing call to super
This commit is contained in:
Yannick Payot
2023-05-24 16:09:11 +02:00
parent dc83bd74b3
commit 9ca3f6a710
83 changed files with 1714 additions and 912 deletions
+29 -21
View File
@@ -4,38 +4,46 @@
from odoo import models
from odoo.http import request
from ..statsd_client import statsd, customer, environment
from ..statsd_client import customer, environment, statsd
class IrHttp(models.AbstractModel):
_inherit = 'ir.http'
_inherit = "ir.http"
@classmethod
def _dispatch(cls):
if not statsd:
return super()._dispatch()
path_info = request.httprequest.environ.get('PATH_INFO')
if path_info.startswith('/longpolling/'):
path_info = request.httprequest.environ.get("PATH_INFO")
if path_info.startswith("/longpolling/"):
return super()._dispatch()
parts = ['http', ]
if path_info.startswith('/web/dataset/call_button'):
parts += ['button',
customer, environment,
request.params['model'].replace('.', '_'),
request.params['method'],
]
elif path_info.startswith('/web/dataset/exec_workflow'):
parts += ['workflow',
customer, environment,
request.params['model'].replace('.', '_'),
request.params['signal'],
]
parts = [
"http",
]
if path_info.startswith("/web/dataset/call_button"):
parts += [
"button",
customer,
environment,
request.params["model"].replace(".", "_"),
request.params["method"],
]
elif path_info.startswith("/web/dataset/exec_workflow"):
parts += [
"workflow",
customer,
environment,
request.params["model"].replace(".", "_"),
request.params["signal"],
]
else:
parts += ['request',
customer, environment,
]
parts += [
"request",
customer,
environment,
]
with statsd.timer('.'.join(parts)):
with statsd.timer(".".join(parts)):
return super()._dispatch()