Change CI to GitHub actions

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

Apply linting
This commit is contained in:
Yannick Payot
2023-05-24 18:22:55 +02:00
parent 05d111f7c1
commit d17d229b13
86 changed files with 1441 additions and 634 deletions
-1
View File
@@ -1,2 +1 @@
from . import models
+1 -1
View File
@@ -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
View File
@@ -1,2 +1 @@
from . import ir_http
+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, 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)
+12 -12
View File
@@ -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,
}