|
|
@ -6,6 +6,7 @@ from datetime import datetime |
|
|
|
|
|
|
|
from werkzeug.exceptions import NotFound |
|
|
|
|
|
|
|
from odoo import SUPERUSER_ID |
|
|
|
from odoo.http import Controller, request, route |
|
|
|
|
|
|
|
from odoo.addons.web.controllers.main import ensure_db |
|
|
@ -18,6 +19,12 @@ class ConsentController(Controller): |
|
|
|
def consent(self, choice, consent_id, token, *args, **kwargs): |
|
|
|
"""Process user's consent acceptance or rejection.""" |
|
|
|
ensure_db() |
|
|
|
try: |
|
|
|
# If there's a website, we need a user to render the template |
|
|
|
request.uid = request.website.user_id.id |
|
|
|
except AttributeError: |
|
|
|
# If there's no website, the default is OK |
|
|
|
pass |
|
|
|
consent = request.env["privacy.consent"] \ |
|
|
|
.with_context(subject_answering=True) \ |
|
|
|
.sudo().browse(consent_id) |
|
|
|