|
@ -1,12 +1,18 @@ |
|
|
# -*- coding: utf-8 -*- |
|
|
# -*- coding: utf-8 -*- |
|
|
# Copyright 2016-2017 Compassion CH (http://www.compassion.ch) |
|
|
# Copyright 2016-2017 Compassion CH (http://www.compassion.ch) |
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). |
|
|
import simplejson |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import logging |
|
|
from odoo.http import JsonRequest, Root, Response |
|
|
from odoo.http import JsonRequest, Root, Response |
|
|
|
|
|
|
|
|
# Monkeypatch type of request rooter to use RESTJsonRequest |
|
|
# Monkeypatch type of request rooter to use RESTJsonRequest |
|
|
old_get_request = Root.get_request |
|
|
old_get_request = Root.get_request |
|
|
|
|
|
_logger = logging.getLogger(__name__) |
|
|
|
|
|
|
|
|
|
|
|
try: |
|
|
|
|
|
import simplejson |
|
|
|
|
|
except ImportError: |
|
|
|
|
|
_logger.error("Please install simplejson tu use mail_sendgrid module") |
|
|
|
|
|
_logger.debug("ImportError details:", exc_info=True) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_request(self, httprequest): |
|
|
def get_request(self, httprequest): |
|
|