[MIG] pingen: Migration to 16.0

Standard migration, incl. changes proposed in https://github.com/OCA/report-print-send/pull/290/
Add unit test.
This commit is contained in:
Anna Janiszewska
2023-01-30 14:46:41 +01:00
parent b72b28f004
commit 0d8676547a
27 changed files with 2401 additions and 372 deletions

View File

@@ -17,12 +17,12 @@ _logger = logging.getLogger(__name__)
class PingenController(http.Controller):
def _verify_signature(self, request_content):
webhook_signature = http.request.httprequest.headers.get("Signature")
companies = (
http.request.env["res.company"]
.sudo()
.search([("pingen_webhook_secret", "!=", False)])
)
companies = http.request.env["res.company"].sudo().search([])
for company in companies:
# We could not search on `pingen_webhook_secret
# if this field is computed (e.g. env field)
if not company.pingen_webhook_secret:
continue
secret_signature = hmac.new(
company.pingen_webhook_secret.encode("utf-8"),
request_content,