The tests consist in sending a mail related to a record to a customer and checking that the record can be viewed through the embedded link: - either in the backend if the user is connected and has the right to - or in the portal otherwise It also test that if the embedded link is tampered, the access is forbidden. Task-2797311 closes odoo/odoo#105405 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
15 lines
538 B
Python
15 lines
538 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
|
|
from odoo import http
|
|
from odoo.http import request
|
|
|
|
|
|
class PortalTest(http.Controller):
|
|
"""Implements some test portal routes (ex.: for viewing a record)."""
|
|
|
|
@http.route('/my/test_portal/<int:res_id>', type='http', auth='public', methods=['GET'])
|
|
def test_portal_record_view(self, res_id, access_token=None, **kwargs):
|
|
return request.make_response(f'Record view of test_portal {res_id} ({access_token}, {kwargs})')
|