from .. import controller from odoo import http from odoo.http import request import json class Wati(controller.Controller): prefix = '/api/v1/' @http.route(prefix + 'wati/notification', auth='none', type='json', csrf=False, cors='*', methods=['POST', 'OPTIONS']) def notification(self, **kw): json_raw = json.loads(request.httprequest.data) request.env['wati.notification'].create([{ 'json_raw': json_raw }]) return