blob: 01b32653a2c42fbe5e06843bf40a6528b98cbb9e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
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)
json_dump = json.dumps(json_raw, indent=4, sort_keys=True)
request.env['wati.notification'].create([{
'json_raw': json_dump
}])
return
|