mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-23 18:04:34 +00:00
Change CI to GitHub actions
Use copier template from oca/oca-addons-repo-template Apply linting
This commit is contained in:
@@ -1,2 +1 @@
|
||||
|
||||
from . import models
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"web",
|
||||
"server_environment",
|
||||
],
|
||||
"website": "http://www.camptocamp.com",
|
||||
"website": "https://github.com/camptocamp/odoo-cloud-platform",
|
||||
"data": [],
|
||||
"external_dependencies": {
|
||||
"python": ["statsd"],
|
||||
|
||||
@@ -1,2 +1 @@
|
||||
|
||||
from . import ir_http
|
||||
|
||||
@@ -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, endpoint):
|
||||
if not statsd:
|
||||
return super()._dispatch(endpoint)
|
||||
|
||||
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(endpoint)
|
||||
|
||||
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(endpoint)
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
_MAP = {
|
||||
'y': True,
|
||||
'yes': True,
|
||||
't': True,
|
||||
'true': True,
|
||||
'on': True,
|
||||
'1': True,
|
||||
'n': False,
|
||||
'no': False,
|
||||
'f': False,
|
||||
'false': False,
|
||||
'off': False,
|
||||
'0': False
|
||||
"y": True,
|
||||
"yes": True,
|
||||
"t": True,
|
||||
"true": True,
|
||||
"on": True,
|
||||
"1": True,
|
||||
"n": False,
|
||||
"no": False,
|
||||
"f": False,
|
||||
"false": False,
|
||||
"off": False,
|
||||
"0": False,
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user